1.ZOJ 1078
Palindrom Numbers
Time Limit: 2000 msMemory 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

文章提供了三个编程问题的解析。第一个问题是检查一个数在2到16的任何基数下是否为回文数。第二个问题涉及实现一个名为Quicksum的校验和算法,用于计算数据包的校验值。第三个问题要求找出给定正整数在二进制表示中的所有1的位置。
最低0.47元/天 解锁文章
552

被折叠的 条评论
为什么被折叠?



