Pagini recente » Cod sursa (job #883248) | Cod sursa (job #1112967) | Cod sursa (job #1692941) | Cod sursa (job #1187633) | Cod sursa (job #1320824)
program submultimi;
var a:array [1..16] of byte;
i,j,n:longint;
fi,fo:text;
Begin
assign(fi,'submultimi.in');
assign(fo,'submultimi.out');
reset(fi); rewrite(fo);
read(fi,n);
For i:=1 to (1 shl n) -1 do begin
inc(a[1]);
for j:=1 to n do begin
if a[j] > 1 then begin
a[j]:=0;
inc(a[j+1]);
end;
if a[j]=1 then write(fo,j,' ');
end;
writeln(fo);
end;
close(fo);
end.