C++ 代码
class Solution {
public:
vector<vector<int> > findContinuousSequence(int sum) {
vector<vector<int> > ans;
for(int i = 1; i < sum; i++) {
int res = 0;
vector<int> tmp;
for(int j = i; j < sum; j++) {
tmp.push_back(j);
res += j;
if(res >= sum) break;
}
if(res == sum) ans.push_back(tmp);
}
return ans;
}
};