Kiểm tra cấp số cộng của dãy

HuanBuiThanh

 

program bai5_chuong4; uses crt; var A: array[1..100] of integer; d,rt,i,N, dem: integer; begin clrscr; write ('Nhap N:'); readln(N); while ((n <= 2) or (n >= 100)) do begin write ('Xin moi Nhap lai:'); readln(N); end; for i:=1 to n do begin write ('Nhap A[',i,']'); readln(a[i]); while ((n <= -100) or (n >= 100)) do begin write ('Nhap sai , xin moi nhap lai A[',i,']'); readln(a[i]); end; end; d := A[2] - A[1]; dem := 0; i:=3; While (i <=N) and (A[i]=A[1]+(i-1)*d) do i:=i+1; If i > N Then Writeln('Day A la cap so cong') Else Writeln('Day A khong la cap so cong'); readln; end.

Getting Info...

إرسال تعليق

Cảm ơn bạn đã quan tâm và gửi nhận xét tại
http://huanbuithanh.blogspot.com
hãy ghé thăm blog hàng ngày để được cập nhật những thủ thuật mới nhất nhé . thân ái !
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.