Const n=5; var a,b:array[1..n] of integer; i,sa,sb:integer; begin Randomize; for i:=1 to n do begin a[i]:=random(10)-5; write(a[i]:3); end; writeln; for i:=1 to n do begin b[i]:=random(10)-5; write(b[i]:3); end; writeln; sa:=0; sb:=0; for i:=1 to n do begin sa:=sa+a[i]; sb:=sb+b[i]; end; writeln('sa=',sa,' sb=',sb,' P=',sa*sb); end.
var a,b:array[1..n] of integer;
i,sa,sb:integer;
begin
Randomize;
for i:=1 to n do
begin
a[i]:=random(10)-5;
write(a[i]:3);
end;
writeln;
for i:=1 to n do
begin
b[i]:=random(10)-5;
write(b[i]:3);
end;
writeln;
sa:=0; sb:=0;
for i:=1 to n do
begin sa:=sa+a[i]; sb:=sb+b[i]; end;
writeln('sa=',sa,' sb=',sb,' P=',sa*sb);
end.