Cod sursa(job #679461)
Utilizator | Laszlofi Zoltan-Ioan laszlofi | Data | 13 februarie 2012 11:56:41 |
---|---|---|---|
Problema | Submultimi | Scor | 100 |
Compilator | fpc | Status | done |
Runda | Arhiva educationala | Marime | 0.52 kb |
var f:text;
a:array[1..17] of integer;
i,j,n:byte;
y,x:longint;
begin
assign(f,'submultimi.in');reset(f);readln(f,n);close(f);
assign(f,'submultimi.out');rewrite(f);
y:=1;
fillchar(a, sizeof(a),0);
for i:=1 to n do y:=y*2;
y:=y-1;
for x:=1 to y do begin
i:=1;
while a[i]=1 do begin
a[i]:=0;
inc(i);
end;
a[i]:=1;
for j:=1 to n do
if a[j]=1 then write(f,j,' ');
writeln(f);
end;
close(f);
end.