uses crt;
Var
A:array[1..100] of integer;
i,n,d: integer;
CS: boolean;
BEGIN
clrscr;
repeat
Write(' Nhap vao so nguyen duong N <=100 : ');
readln(N);
Until (n>1) and (n<=100);
For i:=1 to n do
begin
repeat
write('A[',i,'] = ');
readln(A);
until abs(A)<=1000;
end;
d:=abs(A[2]-A[1]);
CS:=True;
For i:=2 to n do
IF (abs(A-A[i-1])<>d) then
begin
CS:=False;
break;
end;
IF CS then writeln('Day la cap so cong ')
else writeln(' Day ko phai la cap so cong ');
readln;
END.
0 nhận xét:
Đăng nhận xét