uses Crt; const n=50; type Vec=array [1..n] of integer; var A: Vec; i, Sum, Col: integer; begin ClrScr; Randomize; Sum:=0; Col:=0; for i:=1 to n do begin A[i]:=10+random(40); Write(A[i]: 4); if (i mod 10 =0 ) then WriteLn; if (A[i] mod 7 = 1) or (A[i] mod 7 = 2) or (A[i] mod 7 = 5 ) then begin Sum:=Sum+A[i]; Col:=Col+1; end; end; WriteLn; WriteLn (' Sum = ', Sum); WriteLn (' Col = ', Col); ReadLn; end.
uses Crt;
const n=50;
type Vec=array [1..n] of integer;
var A: Vec;
i, Sum, Col: integer;
begin
ClrScr;
Randomize;
Sum:=0;
Col:=0;
for i:=1 to n do
begin
A[i]:=10+random(40);
Write(A[i]: 4);
if (i mod 10 =0 ) then WriteLn;
if (A[i] mod 7 = 1) or (A[i] mod 7 = 2) or (A[i] mod 7 = 5 ) then
begin
Sum:=Sum+A[i];
Col:=Col+1;
end;
end;
WriteLn;
WriteLn (' Sum = ', Sum);
WriteLn (' Col = ', Col);
ReadLn;
end.