var a: array[1..100] of integer;
n,i,s:integer;
begin
i:=1;
readln(n);
while not(i=n) do
a[i]:= random(61)-20;
inc(i);
end;
write(a[i],' ');
if (a[i] mod 2 = 0 ) then s:=a[i];
i:=i+1;
writeln;
write(s);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
var a: array[1..100] of integer;
n,i,s:integer;
begin
i:=1;
readln(n);
while not(i=n) do
begin
a[i]:= random(61)-20;
inc(i);
end;
i:=1;
while not(i=n) do
begin
write(a[i],' ');
inc(i);
end;
i:=1;
while not(i=n) do
begin
if (a[i] mod 2 = 0 ) then s:=a[i];
i:=i+1;
end;
writeln;
write(s);
end.