Jennifer
2018年2月2日16:32:52-2018年2月2日17:04:38
n%10求的是最高位,n/100求的是个位
*/
#include <iostream>
#include <cmath>
using namespace std;
bool isPrim(int n)
{
int sqr = sqrt(n * 1.0);
for(int i=2;i<sqr;i++) //注意:i是从2开始
{
if(n%i == 0)
return false;
}
return true;
}
int main()
{
int n;
while(cin>>n)
{
if(n>100 && n<1000 && n%10 == n/100 && isPrim(n))
{
cout<<"Yes"<<endl;
}
else
{
cout<<"No"<<endl;
}
}
return 0;
}