type massiv = array [2..21] of integer; var mass : massiv; i, summa : integer;
begin summa := 0; for i:=2 to 21 do begin mass[i]:=i; if (mass[i] mod 2 = 0) then summa := summa + mass[i] end; writeln('Сумма четных эл-тов равна : ', summa); readln; end.
program z; var a : array[2..21] of integer; i,summ : integer; b : array[2..21] of integer;
begin for i:= 2 to 21 do begin a[i]:=i; end;
for i:=2 to 21 do begin if a[i] mod 2 = 0 then begin b[i]:=a[i]; end;
end;
summ:=0; for i:=2 to 21 do begin summ:=summ+b[i]; end; Writeln(summ); readln;
massiv = array [2..21] of integer;
var
mass : massiv;
i, summa : integer;
begin
summa := 0;
for i:=2 to 21 do
begin
mass[i]:=i;
if (mass[i] mod 2 = 0) then
summa := summa + mass[i]
end;
writeln('Сумма четных эл-тов равна : ', summa);
readln;
end.
program z;
var
a : array[2..21] of integer;
i,summ : integer;
b : array[2..21] of integer;
begin
for i:= 2 to 21 do
begin
a[i]:=i;
end;
for i:=2 to 21 do
begin
if a[i] mod 2 = 0 then
begin
b[i]:=a[i];
end;
end;
summ:=0;
for i:=2 to 21 do
begin
summ:=summ+b[i];
end;
Writeln(summ);
readln;
end.