仅供参考

rdsrgssh 2020-07-24 14:49:21 2021-03-21 20:07:14 30 返回题目

#include<bits/stdc++.h>

using namespace std;

long long int n;

bool gg(int k)

{
	
    //if(k<=1)

		//return false;

	for(int i=2;i*i<=k;i++)

		if(k%i==0)

			return false;

	return true;

}

int main()
{
    
	while(cin>>n)
	{
		long long p=sqrt(n);
		
		if(p*p==n && gg(p))
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	retun 0;
}
{{ vote && vote.total.up }}

共 1 条回复

wjh123456