题解
2025-07-22 17:23:39
发布于:广东
5阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
bool isPrime(int x)
{
if(x<2) return false;
for(int i=2;i*i<=x;i++)
if (x%i==0)
return false;
return true;
}
int main()
{
int n;
cin>>n;
if(isPrime(n)) cout<<"Yes";
else cout<<"No";
return 0;
}
这里空空如也
有帮助,赞一个