Program Pr1; uses crt; const n=20; var mas:array[1..n,1..n] of integer; i,j,v:integer; Begin clrscr; v:=0; randomize; for j:=1 to n do for i:=1 to n do mas[i,j]:=random(10); for j:=1 to n do for i:=1 to n do v:=v+mas[i,j]; writeln('Summa=',v); {a} v:=0; for j:=1 to n do for i:=1 to n do v:=v+sqr(mas[i,j]); writeln('Summa SQR=',v); {б} end.
Program Pr1;
uses crt;
const n=20;
var mas:array[1..n,1..n] of integer;
i,j,v:integer;
Begin
clrscr;
v:=0;
randomize;
for j:=1 to n do
for i:=1 to n do mas[i,j]:=random(10);
for j:=1 to n do
for i:=1 to n do v:=v+mas[i,j];
writeln('Summa=',v); {a}
v:=0;
for j:=1 to n do
for i:=1 to n do v:=v+sqr(mas[i,j]);
writeln('Summa SQR=',v); {б}
end.