uses crt; var a:array[1..1000] of integer; n,i,max:integer; begin clrscr; write(‘Nhap so luong phan tu: ‘); readln(n); for i:=1 to n do begin write(‘a[‘,i,’]: ‘); readln(a[i]); end; max:=a[1]; for i:=1 to n do if a[i]>max then max:=a[i]; write(‘So lon nhat: ‘,max); readln; end.
program tim_max;
uses crt;
var A:array[1..1000] of integer;
n,i,max:integer;
begin
clrscr;
write(‘Nhap so luong phan tu: ‘); readln(n);
for i:=1 to n do
begin
write(‘A[‘,i,’]= ‘); readln(A[i]);
end;
max:=A[1];
for i:=2 to n do
if A[i]>max then max:=A[i];
write(‘Max la: ‘,max);
readln;
end.
uses crt;
var a:array[1..1000] of integer;
n,i,max:integer;
begin
clrscr;
write(‘Nhap so luong phan tu: ‘); readln(n);
for i:=1 to n do
begin
write(‘a[‘,i,’]: ‘); readln(a[i]);
end;
max:=a[1];
for i:=1 to n do if a[i]>max then max:=a[i];
write(‘So lon nhat: ‘,max);
readln;
end.