标签:des style blog http color java os io strong
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1431
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 11346 Accepted Submission(s):
2638
1 #include <iostream> 2 #include <cstdio> 3 using namespace std; 4 int a[10000001]; 5 6 int sushu(int n) 7 { 8 if(n==2)return 1; 9 for(int i=2; i*i<=n; i++) 10 if(n%i==0) 11 return 0; 12 return 1; 13 } 14 int find(int n) 15 { 16 int m=0,t=n; 17 while(t) 18 { 19 m=m*10+t%10; 20 t/=10; 21 } 22 if(m==n) 23 return 1; 24 return 0; 25 } 26 27 int main() 28 { 29 int n,m; 30 while(cin>>n>>m) 31 { 32 for(int i=n;i<=m&&i<=9989899;i++) 33 if (find(i)&&sushu(i)) 34 printf("%d\n",i); 35 printf("\n"); 36 } 37 }
标签:des style blog http color java os io strong
原文地址:http://www.cnblogs.com/qq-star/p/3930920.html