HustOJ - 1014

 1 #include<stdio.h> 
 2 int main() 
 3 {
 4     int x,i,n,a,c;
 5     while(scanf("%d",&x)==1)
 6     {
 7         if (x>=100 && x<=999) 
 8         {
 9             n=0;
10             for (i=1;i<=x;i++) 
11             {
12                 if (x%i==0) 
13                 {
14                     n=n+1;
15                 }
16             }
17             
18             if (n==2)
19             {
20                 a=x/100;
21                 c=x%10;
22                  if (a==c) 
23                  {
24                      printf("Yes\n") ;
25                  }
26             }
27             else
28             printf("No\n") ;
29         }
30         else
31         printf("No\n") ;
32     }
33 }
1014 对称三位数素数

 

posted @ 2017-05-04 12:35  浮华散丶  阅读(61)  评论(0编辑  收藏  举报