1-задача
var A:array[1..100]of integer;
i,summa,n:integer;
begin
randomize;
Write('N='); Readln(N);
for i:=1 to n do begin A[i]:=random(100); Writeln(A[i]); end;
for i:=1 to n do begin
if A[i] mod 8 = 0 then Summa:=Summa + A[i];
end;
Writeln('Сумма=', Summa);
end.
2-задача
var B:array[1..8]of integer;
summa,i:integer;
begin
randomize;
for i:=1 to 8 do begin B[i]:=random(100); Writeln(B[i]); end;
for i:=1 to 8 Do begin
if odd(b[i]) then Summa:=Summa+B[i];
end;
Writeln('Сумма=', Summa);
end.