这个简单:
for a=1 to 100do
for b=1 to 100do
for c=1 to 100do
......
if a+b+c+.....=100 then
memo1.lines.add(inttostr(a)+inttostr(b)+inttostr(c)+...
....
end;
这个应该不算太难,拿weiliu的程序做剪枝:
for a=0 to 100do
for b=0 to 100-ado
for c=0 to 100-a-bdo
......
{
j=100-a-b-c-d-e-f-...
memo1.lines.add(inttostr(a)+inttostr(b)+inttostr(c)+...
}
....