组合的生成(1..n中选取k个数的所有方案)pr
19 查阅
参考答案:
begin
\r\n
if dep=k+1 then begin writeln(s);exit; end;
for i:=1 to n do
if (not used[i]) and (i>pre) then begin
s:=s+chr(i+ord(''0''));used[i]:=true;
solve(dep+1,i);
s:=copy(s,1,length(s)-1); used[i]:=fal