这个问题比较简单,我现写一个吧,没有上机试过,不过应该不会错的[8D]
const maxn=100000;
var
ans:array[1..maxn] of integer;
n:integer;
procedure printout(c:integer);
var i:integer;
begin
for i:=1 to c do
write(ans,' ');
writeln;
end;
procedure nextone(nowmax,count:integer);
var i:integer;
begin
for i:=1 to nowmax do
begin
asn[count]:=i;
if nowmax-i=0 then
printout(count)
else
nextone(nowmax-i,count+1);
end;
end;
begin
readln;
nextone(n,1);
end.