Program z; Var a:array [1..5] of integer; i, max, k :intefer; Begin max:=-999999; For i:=1 to 5 do begin Write ('a [, i, '] = '); read (a[i]); if a[i] > max then begin max:= a[i]; k:=i; end; end; writeln; write (max, ' ', k); end.
Uses crt; var mas: array [1..5] of integer; x, max, pos: integer; begin max:=-maxint; for x:=1 to 5 do begin write('mas[',x,']: '); readln(mas[x]); if mas[x]>max then begin max:=mas[x]; pos:=x; end; end; writeln; write('Максимальный элемент: ',max,'. Позиция элемента: ',pos); end.
Var a:array [1..5] of integer;
i, max, k :intefer;
Begin
max:=-999999;
For i:=1 to 5 do begin
Write ('a [, i, '] = '); read (a[i]);
if a[i] > max then begin
max:= a[i];
k:=i;
end;
end;
writeln;
write (max, ' ', k);
end.
var mas: array [1..5] of integer;
x, max, pos: integer;
begin
max:=-maxint;
for x:=1 to 5 do begin
write('mas[',x,']: ');
readln(mas[x]);
if mas[x]>max then begin
max:=mas[x];
pos:=x;
end;
end;
writeln;
write('Максимальный элемент: ',max,'. Позиция элемента: ',pos);
end.