1)
Program n1;
const n = 10;
var m:array [1..n] of integer;
i,sum: integer;
begin
randomize;
sum:=0;
for i:=1 to n do
begin
m[i]:=random(101);
if m[i] mod 2=0 then sum:=sum+m[i];
end;
writeln('сумма четных: ',sum);
end.
2)
Program n2;
const n = 5;
var m:array [1..n] of integer;
i,min,max : integer;
begin
for i:=1 to n do readln(m[i]);
max := m[1];
min := m[1];
for i :=1 to n do begin
if max < m[i] then max := m[i];
if min > m[i] then min := m[i];
end;
writeln('Сумма максимального и минимального: ', max+min);
end.