Var z:array[1..1000] of longint;
n, i, max:longint;
Begin
Readln(n);
For i:=1 to n do begin writeln('s',i,'=');
Readln(z[i]);
max:= z[1];
End;
For i:=1 to n do begin if max<z[i] then max:=z[i];
Writeln('So lon nhat la ',max);
End.
Bạn thử kiểm tra trên Pascal nhé.
uses crt;
var i,n,m:longint;
a:array[1..1000]of integer;
begin
write('nhap do dai cua day so:');readln(n);
for i:=1 to n do begin
write('nhap phan tu thu ',i,' cua mang:');readln(a[i]);
if i=1 then m:=a[1]
else if a[i]>m then m:=a[i];
end;
write('gia tri lon nhat trong day so la:',m);
readln
end.