Var ma:array of array of integer; i,j,n,r:integer; begin readln(n); setlength(ma,n+1); for i:=1 to n do setlength(ma[i],n+1); writeln('Matrix:'); for i:=1 to n do begin writeln; for j:=1 to n do begin ma[i,j]:=random(n); write(ma[i,j]:4); end; end; for i:=1 to n do for j:=i+1 to n do r:=r+ma[i,j]; r:=r div 3; writeln; if odd(r) then writeln('Да') else writeln('Нет'); end.
Var ma:array of array of integer; i,j,n,r:integer; begin readln(n); setlength(ma,n+1); for i:=1 to n do setlength(ma[i],n+1); writeln('Matrix:'); for i:=1 to n do begin writeln; for j:=1 to n do begin ma[i,j]:=random(n); write(ma[i,j]:4); end; end; for i:=1 to n do for j:=i+1 to n do r:=r+ma[i,j]; r:=r div 3; writeln; if odd(r) then writeln('Да') else writeln('Нет'); end.
Var
ma:array of array of integer;
i,j,n,r:integer;
begin
readln(n);
setlength(ma,n+1);
for i:=1 to n do
setlength(ma[i],n+1);
writeln('Matrix:');
for i:=1 to n do
begin
writeln;
for j:=1 to n do
begin
ma[i,j]:=random(n);
write(ma[i,j]:4);
end;
end;
for i:=1 to n do
for j:=i+1 to n do
r:=r+ma[i,j];
r:=r div 3;
writeln;
if odd(r) then writeln('Да') else writeln('Нет');
end.
Пример ввода:
4
Пример вывода:
Matrix:
0 1 3 3
3 0 0 3
2 3 0 2
3 0 2 3
Нет
Var
ma:array of array of integer;
i,j,n,r:integer;
begin
readln(n);
setlength(ma,n+1);
for i:=1 to n do
setlength(ma[i],n+1);
writeln('Matrix:');
for i:=1 to n do
begin
writeln;
for j:=1 to n do
begin
ma[i,j]:=random(n);
write(ma[i,j]:4);
end;
end;
for i:=1 to n do
for j:=i+1 to n do
r:=r+ma[i,j];
r:=r div 3;
writeln;
if odd(r) then writeln('Да') else writeln('Нет');
end.
Пример ввода:
4
Пример вывода:
Matrix:
0 1 3 3
3 0 0 3
2 3 0 2
3 0 2 3
Нет