program nnn;
uses crt;
var
i,m:integer;
a:array[1..40] of integer;
begin
for i:=1 to 40 do
read(a[i]);
end;
m:=a[1];
if a[i] mod 2 = 0 then if m>a[i] then m:=a[i];
writeln(m);
end.
если без массива:
i,c,m:integer;
read(c);
if i=1 then m:=c;
if c mod 2 = 0 then if m>c then m:=c;
program nnn;
uses crt;
var
i,m:integer;
a:array[1..40] of integer;
begin
for i:=1 to 40 do
begin
read(a[i]);
end;
m:=a[1];
for i:=1 to 40 do
begin
if a[i] mod 2 = 0 then if m>a[i] then m:=a[i];
end;
writeln(m);
end.
если без массива:
program nnn;
uses crt;
var
i,c,m:integer;
begin
for i:=1 to 40 do
begin
read(c);
if i=1 then m:=c;
if c mod 2 = 0 then if m>c then m:=c;
end;
writeln(m);
end.