Консольное приложение: const n=4; var a:array[1..n,1..n] of real; k,i,j:integer; begin writeln('1:'); for i:=1 to n do begin for j:=1 to n do begin a[i,j]:=10*random; write(a[i,j]:4:1); end; writeln; end; write('k = '); readln(k); writeln('2:'); for j:=1 to n do a[k,j]:=a[k,j]/a[k,k]; for i:=1 to n do begin for j:=1 to n do write(a[i,j]:4:1); writeln; end; end.
{$APPTYPE CONSOLE} Var Mass:array[1..10000,1..10000] of real; n,k,i,j:integer; Begin Randomize; Write('n = ');ReadLn(n); For i:= 1 to n do Begin For j:= 1 to n do Begin Mass[i,j]:=random*21-10; Write(Mass[i,j]:5:2,' ') End; WriteLn End; Write('k = ');ReadLn(k); For j:= 1 to n do Mass[k,j]:=Mass[k,j]/Mass[k,k]; For i:= 1 to n do Begin For j:= 1 to n do Write(Mass[i,j]:5:2,' '); WriteLn End; ReadLn End.
const n=4;
var a:array[1..n,1..n] of real;
k,i,j:integer;
begin
writeln('1:');
for i:=1 to n do
begin
for j:=1 to n do
begin
a[i,j]:=10*random;
write(a[i,j]:4:1);
end;
writeln;
end;
write('k = ');
readln(k);
writeln('2:');
for j:=1 to n do a[k,j]:=a[k,j]/a[k,k];
for i:=1 to n do
begin
for j:=1 to n do write(a[i,j]:4:1);
writeln;
end;
end.
Пример: 1:
1.4 0.8 5.3 9.6
6.7 2.4 5.1 4.0
1.9 6.6 0.9 4.0
4.1 6.1 2.6 0.9
k = 2
2:
1.4 0.8 5.3 9.6
2.8 1.0 5.1 4.0
1.9 6.6 0.9 4.0
4.1 6.1 2.6 0.9
Var
Mass:array[1..10000,1..10000] of real;
n,k,i,j:integer;
Begin
Randomize;
Write('n = ');ReadLn(n);
For i:= 1 to n do
Begin
For j:= 1 to n do
Begin
Mass[i,j]:=random*21-10;
Write(Mass[i,j]:5:2,' ')
End;
WriteLn
End;
Write('k = ');ReadLn(k);
For j:= 1 to n do
Mass[k,j]:=Mass[k,j]/Mass[k,k];
For i:= 1 to n do
Begin
For j:= 1 to n do
Write(Mass[i,j]:5:2,' ');
WriteLn
End;
ReadLn
End.