Var a:array[1..30] of integer;
i,max,d:integer;
Begin
For i:=1 to 30 do
Begin
Repeat
Write('Nhap phan tu thu ',i,' = ');readln(a[i]);
Until a[i]<=255;
End;
max:=a[1];
d:=1;
For i:=2 to 30 do
If a[i] > max then
Begin
max:=a[i];
d:=i;
End;
Write('Phan tu lon nhat la ',max,' tai vi tri ',i);
Readln
End.
Đúng 2
Bình luận (0)