Pro.ID10123 TitlePrime Palindromes Title链接http://10.20.2.8/oj/exercise/problem?problem_id=10123 AC105 Submit370 Ratio28.38% 时间&空间限制描述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 ≤ 100000000 ); both a and b are considered to be within the range. 输入Multiple test cases. Each case on one line: Two integers, a and b 输出Description 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 ≤ 100000000 ); both a and b are considered to be within the range. Input Multiple test cases. Each case on one line: Two integers, a and b Output For each case, output the list of palindromic primes in numerical order, one per line. After each case, output one blank line. Sample Input 5 500 Sample Output 5 Hint Generate the palindromes and see if they are prime. Generate palindromes by combining digits properly. You might need more than one of the loops like below. /* generate five digit palindrome: */ Source 样例输入5 500 样例输出5 提示Generate the palindromes and see if they are prime. Generate palindromes by combining digits properly. You might need more than one of the loops like below. /* generate five digit palindrome: */ |