![](https://img-blog.csdn.net/20170414132321714?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvR1FfQk9C/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
using namespace std;
//1047 素数判定
bool isPrime(int n){
if(n<=1) return false;
if(n==2||n==3) return true;
for(int i=2;i<=sqrt(n);i++)
if(n%i==0) return false;
return true;
}
int main(){
int n;
while(scanf("%d",&n)!=EOF){
if(isPrime(n)) printf("yes\n");
else printf("no\n");
}
return 0;
}
/**************************************************************
Problem: 1047
User: cust123
Language: C++
Result: Accepted
Time:0 ms
Memory:1532 kb
****************************************************************/