会C的大侠们来帮下忙

来源:百度知道 编辑:UC知道 时间:2024/09/21 08:04:58
The number 151 is a prime palindrome because it is both a prime number and a palindrome (it is the same number when read forward as backward). Write a program that finds all prime palindromes in the range of two supplied numbers a and b (5 <= a < b <= 1000,000,000); both a and b are considered to be within the range .

Input
Line 1: Two integers, a and b

Output
The list of palindromic primes in numerical order, one per line.

Sample Input
5 500

Sample Output
5
7
11
101
131
151
181
191
313
353
373
383

最好贴下源码及简单说明、、、、
初学者
麻烦您了o(∩_∩)o
贴下源码呗
麻烦了、、、

十亿的规模,肯定要用高精度!
可以先求出所有的素数,然后依次枚举,判断,不过估计会超时

用什么英文呢?翻译成汉语就有人就给你做了、

思路:先找出1000,000,000内所有素数,在依次判断每个素数是否为palindrome。