Задан двухмерный массив. Расположить все элементы матрицы в строку в порядке возрастания:( в чем ошибка?программа не идет): program niv;
const n=2;
m=2;
var i,j,d:integer;
c:real;
a:array[1..m,1..n] of real;
begin
for i:=1 to n do;
begin
a[i,j]:=random (10)-5;
a[i,j]:=random (10)-5;
writeln(a[i,j]);
end;
for i:=1 to m do
begin
for j:=1 to n-1 do begin
for d:=1 to n-j do begin
if a[i,d]>a[i,d+1]then begin
c:=a[i,d];
a[i,d]:=a[i,d+1];
a[i,d+1]:=c;
end;
end;
end; /////
end;
writeln('сортировка');
for i:=1 to m do begin
for j:=1 to n do begin
writeln(a[i,j]);writeln(a[2,j]);
end;
end;
end.
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Copyright © 2024 SCHOLAR.TIPS - All rights reserved.