// 對稱素數.cpp : Defines the entry point for the console application.
//
//題目說明:判斷所輸入的數,是否為三位數,且是素數,且是對稱的;例如101.
#include "stdafx.h"
#include<iostream>
#include<cmath>
#include<string>
using namespace std;
bool isPrime(int);
int _tmain(int argc, _TCHAR* argv[])
{
int n;
while(cin>>n)
{
cout<<(n>100&&n<1000&&n/100==n%10&&isPrime(n)?"Yes\n":"No\n");
}
return 0;
}
bool isPrime(int n) //判斷是否為素數
{
int sqr=sqrt(n*1.0);
for(int i=2;i<sqr;i++)
{
if(n%i==0)return false;
}
return true;
}