Ответ:
Program zadanie;
const M=4; N=7;
var i,j,sum:integer;
a:array[1..M,1..N] of integer;
begin
for i:=1 to M do begin
for j:=1 to N do begin
a[i,j]:=random(10);
write(a[i,j]:3);
end;
writeln();
i:=2;
while i <= N do begin
print('Сумма элементов ',i,'-ого столбца: ');
for j:=1 to M do begin
sum:=sum+a[j,i];
println(sum);
sum:=0;
i:=i+2;
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
Program zadanie;
const M=4; N=7;
var i,j,sum:integer;
a:array[1..M,1..N] of integer;
begin
for i:=1 to M do begin
for j:=1 to N do begin
a[i,j]:=random(10);
write(a[i,j]:3);
end;
writeln();
end;
i:=2;
while i <= N do begin
print('Сумма элементов ',i,'-ого столбца: ');
for j:=1 to M do begin
sum:=sum+a[j,i];
end;
println(sum);
sum:=0;
i:=i+2;
end;
end.