作者:
金樽馔玉
,
2022-12-22 17:07:40
,
所有人可见
,
阅读 19
//这里填你的代码^^
//注意代码要放在两组三个点之间,才可以正确显示代码高亮哦~
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int n;
void get_divisors(int n)
{
vector<int> res;
for (int i = 1; i <= n / i; i++){
if (n % i == 0){
res.push_back(i);
if (i != n / i){
res.push_back(n / i);
}
}
}
sort(res.begin(), res.end());
for (auto item : res){
cout << item << " ";
}
puts("");
}
int main()
{
cin >> n;
while(n--){
int x;
cin >> x;
get_divisors(x);
}
return 0;
}