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.
сделать блок схему к этой программе
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.
Объяснение:
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.