Pagini recente » Cod sursa (job #2733258) | Cod sursa (job #2391060) | Cod sursa (job #2668506) | Cod sursa (job #522609) | Cod sursa (job #46899)
Cod sursa(job #46899)
var a:array[1..30000]of integer;
n,i,j,x,s:integer;
begin
assign(input,'order.in');
reset(input);
assign(output,'order.out');
rewrite(output);
readln(n);
for i:=1 to n do a[i]:=i;
i:=1;
j:=1;
x:=0;
s:=0;
while x<n do
begin
i:=i+1;
if i>n then i:=1;
if a[i]>0 then s:=s+1;
if s=j then
begin
write(a[i],' ');
a[i]:=-1;
x:=x+1;
j:=j+1;
s:=0;
end;
end;
close(output);
end.