题目链接:分解质因数

#include <iostream>
using namespace std;
void divide(int n)
{
for(int i = 2; i <= n / i; i ++)
{
if(n % i == 0)
{
int res = 0;
while(n % i == 0)
{
n /= i;
res ++;
}
cout << i << ' ' << res << endl;
}
}
if(n > 1) cout << n << ' ' << 1 << endl;
cout << endl;
}
int main()
{
int n;
cin >> n;
while(n--)
{
int x;
cin >> x;
divide(x);
}
return 0;
}
















![[管理与领导-67]:IT基层管理者 - 辅助技能 - 4- 职业发展规划 - 评估你与公司的八字是否相合](https://img-blog.csdnimg.cn/a40cb2123dd44bff8c2fafa39ee8a3bf.png)

