摘要:
输入两个整数 n 和 m,从数列1,2,3.......n 中 随意取几个数,使其和等于 m ,要求将其中所有的可能组合列出来.#include <stdio.h>#include <list>using namespace std;void find(int n, int m){ static list<int> mylist; if(n<0 || m<0) return; if(m>0){ mylist.push_front(n); find(n-1,m-n); mylist.pop_front(); find(n-... 阅读全文
posted @ 2013-03-28 16:45 俊介三在前进 阅读(156) 评论(0) 推荐(0)
浙公网安备 33010602011771号