void comb(int m, int k, int s)<BR>{<BR> int i; <BR> if (s >= k)<BR> {<BR> for (i = 0; i < k; i++)<BR> cout<<a<<" ";<BR> cout << endl;<BR> }<BR> else<BR> {<BR> for (i = 1; i <= m; i++)<BR> if (0 == flag) <BR> {<BR> flag=1;<BR> a=i;<BR> comb(m,k,s+1);<BR> a=0;<BR> flag=0;<BR> }<BR> }<BR>}[em01]
哦void comb(int m, int k, int s)<BR>{<BR>int i; <BR>if (s >= k)<BR>{<BR>for (i = 0; i < k; i++)<BR> cout<<a<<" ";<BR>cout << endl;<BR>}<BR>else<BR>{<BR> for (i = 1; i <= m; i++)<BR> if (0 == flag) <BR> {<BR> flag=1;<BR> a=i;<BR> comb(m,k,s+1);<BR> a=0;<BR> flag=0;<BR> }<BR>}<BR>