#include "stdafx.h"
#include<iostream>
#include<math.h>
using namespace std;
bool judge(int x){
if (x <= 1) return false;
int bound = (int)sqrt(x) + 1;
for (int i = 2; i <bound; i++){
if (x%i == 0){
return false;
}
}
return true;
}
int _tmain(int argc, _TCHAR* argv[])
{
int x;
while (cin>>x)
{
if (judge(x)){
cout <<"yes"<< endl;
}
else
cout <<"no"<< endl;
}
return 0;
}
素数测试1047
最新推荐文章于 2022-11-15 18:02:28 发布