Pagini recente » Cod sursa (job #2533629) | Cod sursa (job #1331024) | Cod sursa (job #7144) | Cod sursa (job #1167586) | Cod sursa (job #1320807)
Program Submultimi;
var a : array[1..16] of byte;
fi, fo : text;
i, j, n : longint;
begin
assign(fi,'submultimi.in'); reset(fi);
assign(fo,'submultimi.out'); 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(fi);
close(fo);
end.