Cod sursa(job #1662418)
| Utilizator | Data | 24 martie 2016 19:12:35 | |
|---|---|---|---|
| Problema | Submultimi | Scor | 0 |
| Compilator | fpc | Status | done |
| Runda | Arhiva educationala | Marime | 0.52 kb |
Program submultimi;
var fi, fo ; text;
n, i, m, nr : longint;
begin assign(fi, 'submultimi.in'); reset(fi);
readln(fi, n); close(fi);
assign(fo, 'submultimi.out'); rewrite(fo);
for m:=1 to 1 shl n-1 do begin nr:=0;
while m>1 shl nr do nr:=nr+1;
for i:=0 to nr do if m and(1 shl i)<>0 then write(fo,i+1,' ');
writeln(fo);
end;
close(fo);
end.