Var a:array[1..10] of integer; sum,chet,s,i:integer; begin sum:=0; s:=0; chet:=0; for i:=1 to 10 do begin a[i]:=random(200)-100; writeln('a[',i,'] = ', a[i]); if a[i] > 0 then sum:=sum+a[i]; if a[i] mod 2 = 0 then chet:=chet+a[i]; if i<6 then s:=s+a[i]; end; writeln('summa polozhitelnix = ',sum); writeln('summa chetnix = ',chet); writeln('simma pervix 5 = ', s); end.
sum,chet,s,i:integer;
begin
sum:=0;
s:=0;
chet:=0;
for i:=1 to 10 do
begin
a[i]:=random(200)-100;
writeln('a[',i,'] = ', a[i]);
if a[i] > 0 then sum:=sum+a[i];
if a[i] mod 2 = 0 then chet:=chet+a[i];
if i<6 then s:=s+a[i];
end;
writeln('summa polozhitelnix = ',sum);
writeln('summa chetnix = ',chet);
writeln('simma pervix 5 = ', s);
end.