##
var a := MatrRandom(10, 10, 0, 50);
a.print(4);
var s,i:integer;
s:=0;
for i:= 0 to 9 do
if a[i, 9-i] mod 3 = 0 then
inc(s, a[i, 9-i]);
print('Сумма=',s);
-------------free pascal-------------
var
a:array[0..9, 0..9]of integer;
i, j, s : integer;
begin
randomize;
for i:=0 to 9 do begin
for j:= 0 to 9 do begin
a[i,j]:= random(50);
write(a[i,j],' ')
end;
writeln();
for i:=0 to 9 do
if a[i,9-i] mod 3 = 0 then
s:=s+a[i,9-i];
writeln(s)
end.
##
var a := MatrRandom(10, 10, 0, 50);
a.print(4);
var s,i:integer;
s:=0;
for i:= 0 to 9 do
if a[i, 9-i] mod 3 = 0 then
inc(s, a[i, 9-i]);
print('Сумма=',s);
-------------free pascal-------------
var
a:array[0..9, 0..9]of integer;
i, j, s : integer;
begin
randomize;
for i:=0 to 9 do begin
for j:= 0 to 9 do begin
a[i,j]:= random(50);
write(a[i,j],' ')
end;
writeln();
end;
s:=0;
for i:=0 to 9 do
if a[i,9-i] mod 3 = 0 then
s:=s+a[i,9-i];
writeln(s)
end.