int num;
cin>>num;
vector<int> factors;
factors.push_back(1);
if(num == 1) return factors;
factors.push_back(num);
int right = num / 2;
for (int i = 2; i < right; ++i) {
if (num % i == 0) {
right = num / i;
factors.push_back(i);
if(i != right) factors.push_back(right);
}
}
return factors;
网友评论