Program asd; Var A,B:array [1..250,1..250] of integer; i,j,n,m,k: integer; BEGIN Write('Введите n: '); Readln(n); Write('Введите m: '); Readln(m); for i:= 1 to n do begin for j:= 1 to m do begin A[i,j]:=random(10); write(A[i,j]:3); end; writeln; end; writeln; for i:= 1 to n do for j:= 1 to m do begin If A[i,j] mod 2=1 then inc(k); end; If n=m then begin Writeln('Транспонирование: '); for i:=1 to n do begin for j:=1 to m do begin write(A[j,i]:3); B[i,j]:=A[i,j]; end; writeln; end; writeln; end else Writeln('Кол-во нечетных элементов: ',k); END.
Var A,B:array [1..250,1..250] of integer;
i,j,n,m,k: integer;
BEGIN
Write('Введите n: '); Readln(n);
Write('Введите m: '); Readln(m);
for i:= 1 to n do
begin
for j:= 1 to m do
begin
A[i,j]:=random(10);
write(A[i,j]:3);
end;
writeln;
end;
writeln;
for i:= 1 to n do
for j:= 1 to m do
begin
If A[i,j] mod 2=1 then inc(k);
end;
If n=m then
begin
Writeln('Транспонирование: ');
for i:=1 to n do
begin
for j:=1 to m do
begin
write(A[j,i]:3);
B[i,j]:=A[i,j];
end;
writeln;
end; writeln;
end
else
Writeln('Кол-во нечетных элементов: ',k);
END.