题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2161
#include<iostream>
#include<cmath>
using namespace std;
int fun(int n)
{
int i,flag=1;
for(i=2;i<=sqrt(n);i++)
{
if(n%i==0) flag=0;
if(!flag) break;
}
return flag;
}
int main()
{
int N,Case=1;
while(cin>>N)
{
if(N<=0) break;
if(N==1||N==2) cout<<Case++<<": "<<"no"<<endl;
else
{
if(fun(N)) cout<<Case++<<": "<<"yes"<<endl;
else cout<<Case++<<": "<<"no"<<endl;
}
}
return 0;
}