90分求助
查看原帖
90分求助
561701
hello___word楼主2023/2/12 10:26
#include <bits/stdc++.h>
using namespace std;
int t;
int main()
{
	cin>>t;
	for(int i = 1; i<= t; i++)
	{
		int n,m,ans=0;
		cin>>n;
		while(n>1)
		{
			m=2;
			while(n%m != 0)
				m++;
			n/=m;
			if(m%2 != 0 )
			{
				ans+=0;//质因数 
			}
			else
				ans++;
		}
		if(ans==0)
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
	}
    return 0;
}

2023/2/12 10:26
加载中...