Program Project2; {$APPTYPE CONSOLE} uses Windows; var n,i,s:integer; a:array of Integer; begin randomize; s:=0; SetConsoleOutputCP(1251); write('Введите длину массива: '); readln(n); SetLength(a,n); for i:=0 to Length(a) do a[i]:=Random(100)-50; for i:=0 to Length(a) do write(a[i]:3); writeln; for i:=0 to Length(a) do if a[i] mod 2 =0 then s:=s+a[i]; writeln('Сумма: ',s); Readln; end.
{$APPTYPE CONSOLE}
uses Windows;
var n,i,s:integer; a:array of Integer;
begin
randomize;
s:=0;
SetConsoleOutputCP(1251);
write('Введите длину массива: ');
readln(n);
SetLength(a,n);
for i:=0 to Length(a) do
a[i]:=Random(100)-50;
for i:=0 to Length(a) do
write(a[i]:3);
writeln;
for i:=0 to Length(a) do
if a[i] mod 2 =0 then
s:=s+a[i];
writeln('Сумма: ',s);
Readln;
end.