HustOJ - 1014
阿新 • • 發佈:2017-05-04
hust tdi sca class splay src hustoj i++ style
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 {1014 對稱三位數素數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 }
HustOJ - 1014