#include <algorithm>
#include <cstring>
#include <iostream>
using namespace std;
int n;
bool check(int n)
{
for (int i = 2; i <= n / i; i++)
{
int s = 0;
while (n)
{
cout << n << endl;
n /= i;
s++;
}
cout << i << " " << s << endl;
}
if (n > 1)
cout << n << " " << 1 << endl;
cout << endl;
return true;
}
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
cin >> n;
int x;
while (n--)
{
cin >> x;
check(x);
}
return 0;
}
求质因数
猜你喜欢
转载自blog.csdn.net/qq_45432665/article/details/104428193
今日推荐
周排行