Var n, i, mn, mx, a:integer; begin writeln('Vvedite n:'); readln(n); writeln('Vvedite chisla iz otrezka (-20;20):'); mn:=0; mx:=0; for i:=1 to n do begin readln(a); if (a mod 2)=0 then if mx<a then mx:=a; if (a mod 2)<>0 then if mn<a then mn:=a; end; writeln('Maximalnoe chetnoe =',mx); writeln('Maximalnoe nechetnoe =',mn); readln(); end.
n, i, mn, mx, a:integer;
begin
writeln('Vvedite n:');
readln(n);
writeln('Vvedite chisla iz otrezka (-20;20):');
mn:=0;
mx:=0;
for i:=1 to n do
begin
readln(a);
if (a mod 2)=0 then
if mx<a then mx:=a;
if (a mod 2)<>0 then
if mn<a then mn:=a;
end;
writeln('Maximalnoe chetnoe =',mx);
writeln('Maximalnoe nechetnoe =',mn);
readln();
end.