文章
116
粉丝
0
获赞
119
访问
6.4k
#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;
}
登录后发布评论
暂无评论,来抢沙发