Pagini recente » Cod sursa (job #2754567) | Autentificare | Cod sursa (job #1378419) | Cod sursa (job #2008932) | Cod sursa (job #686968)
Cod sursa(job #686968)
program sortare;
var f,g:text;
x:array[1..500000] of longint;
aux,i,n:longint;
cond:boolean;
begin
assign (f,'algsort.in'); reset (f);
assign (g,'algsort.out'); rewrite (g);
readln (f,n);
repeat cond:=true;
for i:=1 to n-1 do if (x[i]>x[i+1]) then begin aux:=x[i];
x[i]:=x[i+1];
x[i+1]:=aux;
end;
until (cond);
for i:=1 to n do write (g,x[i],' ');
close (f);
close (g);
end.