Эклео
Var b: array[1..8] of integer; s,i: integer; begin s:=0; for i:=1 to 8 do begin b[i]:=random(11)-5; write (b[i]:3); if (b[i]>0) and (b[i] mod 3 =0) then s:=s+b[i]; end; writeln; writeln ('s = ',s) end. -------------Результат:------------- -4 3 5 -5 3 0 -2 5 s = 6
Answers & Comments
b: array[1..8] of integer;
s,i: integer;
begin
s:=0;
for i:=1 to 8 do begin
b[i]:=random(11)-5;
write (b[i]:3);
if (b[i]>0) and (b[i] mod 3 =0)
then s:=s+b[i];
end;
writeln;
writeln ('s = ',s)
end.
-------------Результат:-------------
-4 3 5 -5 3 0 -2 5
s = 6