const NN=50; var a:array [1..NN,1..NN] of integer; i,j,m,n:integer; begin write('Введите n: '); readln(n); write('Введите m: '); readln(m); 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 a[i,j]<0 then a[i,j]:=abs(a[i,j]); for i:= 1 to n do begin for j:= 1 to m do write(a[i,j],' '); writeln; end; end.
Program a1; Uses crt; const n=8; m=8; Var a:array[1..n,1..m] of integer; i,j:byte; Begin Writeln('Исходная матрица'); For i:=1 to n do begin Writeln; For j:= 1 to m do begin a[i,j]:=random(101)-50; Write(a[i,j],' '); end; end;
Writeln; Writeln('Отредактированная матрица'); For i:=1 to n do begin Writeln; For j:= 1 to m do begin If a[i,j]<0 then a[i,j]:=abs(a[i,j]); Write(a[i,j],' '); end; end; End.
const NN=50;
var
a:array [1..NN,1..NN] of integer;
i,j,m,n:integer;
begin
write('Введите n: ');
readln(n);
write('Введите m: ');
readln(m);
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 a[i,j]<0 then a[i,j]:=abs(a[i,j]);
for i:= 1 to n do
begin
for j:= 1 to m do
write(a[i,j],' ');
writeln;
end;
end.
Program a1;
Uses crt;
const n=8;
m=8;
Var a:array[1..n,1..m] of integer;
i,j:byte;
Begin
Writeln('Исходная матрица');
For i:=1 to n do
begin
Writeln;
For j:= 1 to m do
begin
a[i,j]:=random(101)-50;
Write(a[i,j],' ');
end;
end;
Writeln;
Writeln('Отредактированная матрица');
For i:=1 to n do
begin
Writeln;
For j:= 1 to m do
begin
If a[i,j]<0 then a[i,j]:=abs(a[i,j]);
Write(a[i,j],' ');
end;
end;
End.