Program n1; Uses CRT; Const n=10; Var a: array[1..n] of integer; i,max,k: integer; begin ClrScr; Randomize; For i:=1 to n do begin a[i]:=random(50); write(a[i]:3); end; For i:=1 to n do If a[i] mod 2=0 then If a[i]>max then begin max:=a[i]; k:=i; end; writeln; Writeln('Элемент ',max,' с номером ',k); readln end.
Program n1;
Uses CRT;
Const n=10;
Var a: array[1..n] of integer;
i,max,k: integer;
begin
ClrScr;
Randomize;
For i:=1 to n do
begin
a[i]:=random(50);
write(a[i]:3);
end;
For i:=1 to n do
If a[i] mod 2=0 then
If a[i]>max then
begin
max:=a[i];
k:=i;
end;
writeln;
Writeln('Элемент ',max,' с номером ',k);
readln
end.