figyshkin2
Program mass; var A: array [1..100,1..50] of byte; i,j,n,m,:integer; s:real; begin writeln('Введите элементы массива'); n:=100; m:=50; s:=0; for i:=1 to n do for j:=1 to m do readln(A[i,j]); for i:=1 to n do for j:=1 to m do if (i+j) mod 2 = 1 then s:= s+A[i,j]; writeln('s = ', s); readln; end.
Answers & Comments
var
A: array [1..100,1..50] of byte;
i,j,n,m,:integer;
s:real;
begin
writeln('Введите элементы массива');
n:=100;
m:=50;
s:=0;
for i:=1 to n do
for j:=1 to m do
readln(A[i,j]);
for i:=1 to n do
for j:=1 to m do
if (i+j) mod 2 = 1
then
s:= s+A[i,j];
writeln('s = ', s);
readln;
end.