文章
211
粉丝
1
获赞
1176
访问
57.8k
#include<bits/stdc++.h>
using namespace std;
bool isPrime(int x) {
if (x <= 1)
return false;
for (int i = 2; i * i <= x; ++i)
if (x % i == 0)
return false;
return true;
}
int main(){
int n;
while(cin >> n){
if(isPrime(n))
cout << "yes";
else
cout << "no";
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发