ZOJ 1078 Palindrom Numbers
来源:互联网 发布:淘宝客隐藏优惠券设置 编辑:程序博客网 时间:2024/03/29 09:15
Statement of the Problem
We say that a number is a palindrom if it is the sane when readfrom left to right or from right to left. For example, the number75457 is a palindrom.
Of course, the property depends on the basis in which is numberis represented. The number 17 is not a palindrom in base 10, butits representation in base 2 (10001) is a palindrom.
The objective of this problem is to verify if a set of givennumbers 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 inputends with a zero.
Output Format
Your program must print the message Number i is palindrom inbasis where I is the given number, followed by the basis where therepresentation of the number is a palindrom. If the number is not apalindrom in any basis between 2 and 16, your program must printthe 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
Source: South America2001
源码:
解题报告:
此题属于水题,主要就是进制的转换,然后判断是否满足回文数。
- ZOJ 1078 Palindrom Numbers
- ZOJ 1078 Palindrom Numbers
- zoj 1078 Palindrom Numbers
- ZOJ 1078 :Palindrom Numbers
- zoj 1078 Palindrom Numbers
- ZOJ 1078-Palindrom Numbers
- zoj 1078 Palindrom Numbers
- ZOJ--1078:Palindrom Numbers
- POJ 2247 Humble Numbers
- ZOJ 2536 best balance
- ZOJ 3197 Goole Book
- ZOJ 1633 big string
- ZOJ 2239 In Danger
- ZOJ 1002 Fire Net
- ZOJ 1091 Knight Moves
- ZOJ 1045 Hang Over
- ZOJ 1003 Crashing Balloon
- ZOJ 1008 Gnome Tetravex
- ZOJ 2581 Tour
- ZOJ 2536 best balance
- mysql 数据库日志分析
- ZOJ 3197 Goole Book
- 第八章 定制new和delete
- ZOJ 1078 Palindrom Numbers
- hdu 统计难题(1251)
- ZOJ 1633 big string
- ZOJ 2239 In Danger
- matlab 常用函数
- ZOJ 1037 Gridland
- ZOJ 1002 Fire Net
- ZOJ 1091 Knight Moves
- ZOJ 1067 Color Me Less