Program primer;
const n =10;
var a:array[1..n] of integer;
s,i:integer;
begin
randomize;
for i :=1 to n do
begin
a[i]:=random(19);
readln(' ' ,a[i]);
end;
s:=0;
for i :=1 to n do
s:=s+a[i];
writeln('s=',s);
readln;
end.
program primer2;
const n =10;
var a:array[1..n] of integer;
s,i:integer;
begin
randomize;
for i :=1 to n do
begin
a[i]:=random(19);
readln(' ' ,a[i]);
end;
s:=0;
for i :=1 to n do
if a[i] mod 2=0 then s:=s+a[i];
writeln('s=',s);
readln;
end.
program primer2;
const n =10;
var a:array[1..n] of integer;
s,i:integer;
begin
randomize;
for i :=1 to n do
begin
a[i]:=random(19);
readln(' ' ,a[i]);
end;
s:=0;
for i :=1 to n do
if i mod 2 =0 then s:=s+a[i];
writeln('s=',s);
readln;
end.