zoj 1078 Palindrom Numbers
2014-08-01 22:13
316 查看
Palindrom Numbers
Time Limit: 2 Seconds Memory Limit: 65536 KB
Statement of the Problem
We say that a number is a palindrom if it is the sane when read from left to right or from right to left. For example, the number 75457 is a palindrom.
Of course, the property depends on the basis in which is number is represented. The number 17 is not a palindrom in base 10, but its representation in base 2 (10001) is a palindrom.
The objective of this problem is to verify if a set of given numbers are palindroms in any basis from 2 to 16.
Input Format
Several integer numbers comprise the input. Each number 0 < n < 50000 is given in decimal basis in a separate line. The input ends with a zero.
Output Format
Your program must print the message Number i is palindrom in basis where I is the given number, followed by the basis where the representation of the number is a palindrom. If the number
is not a palindrom in any basis between 2 and 16, your program must print the message Number i is not palindrom.
Sample Input
17
19
0
Sample Output
Number 17 is palindrom in basis 2 4 16
Number 19 is not a palindrom
Time Limit: 2 Seconds Memory Limit: 65536 KB
Statement of the Problem
We say that a number is a palindrom if it is the sane when read from left to right or from right to left. For example, the number 75457 is a palindrom.
Of course, the property depends on the basis in which is number is represented. The number 17 is not a palindrom in base 10, but its representation in base 2 (10001) is a palindrom.
The objective of this problem is to verify if a set of given numbers are palindroms in any basis from 2 to 16.
Input Format
Several integer numbers comprise the input. Each number 0 < n < 50000 is given in decimal basis in a separate line. The input ends with a zero.
Output Format
Your program must print the message Number i is palindrom in basis where I is the given number, followed by the basis where the representation of the number is a palindrom. If the number
is not a palindrom in any basis between 2 and 16, your program must print the message Number i is not palindrom.
Sample Input
17
19
0
Sample Output
Number 17 is palindrom in basis 2 4 16
Number 19 is not a palindrom
相关文章推荐
- zoj1078 Palindrom Numbers
- UVALive2389 ZOJ1078 Palindrom Numbers
- ZOJ1078-Palindrom Numbers
- ZOJ-1078-Palindrom Numbers
- ZOJ&nbsp;1078&nbsp;Palindrom&nbsp;Numbers
- ZOJ 1078 Palindrom Numbers
- ZJU1078-Palindrom Numbers
- 1078 Palindrom Numbers
- ZOJ 1133 Smith Numbers && POJ 1142 Smith Numbers
- ZOJ 1078
- ZOJ Problem Set - 1078 Palindrom Numbers
- TOJ 2424 POJ 2325 ZOJ 1923 Persistent Numbers /贪心 + 大数除法
- zoj 1383 Binary Numbers&&zoj 1491 Climbing Worm(简单)
- ZOJ 1095 Humble Numbers
- ZOJ 3365 Integer Numbers 思路题
- ZOJ 2001 Adding Reversed Numbers
- zoj1078-Palindrom Numbers
- ZOJ Problem Set - 1078(Palindrom Numbers)
- ZOJ Problem Set - 1078 Palindrom Numbers
- zoj 1095 Humble Numbers(丑数+dp)