文件名称:we
介绍说明--下载内容来自于网络,使用问题请自行百度
若一个数(首位不为零)从左向右读与从右向左读都一样,我们就将其称之为回文数。
例如:给定一个10进制数56,将56加65(即把56从右向左读),得到121是一个回文数。
又如:对于10进制数87:
STEP1:87+78 = 165
STEP2:165+561 = 726
STEP3:726+627 = 1353
STEP4:1353+3531 = 4884
在这里的一步是指进行了一次N进制的加法,上例最少用了4步得到回文数4884。
写一个程序,给定一个N(2<=N<=10或N=16)进制数M,求最少经过几步可以得到回文数。
-If a number (the first non-zero) reading from left to right and from right to left the same time, we will call it palindrome. For example: Given a 10-decimal number 56, will be 56 plus 65 (that is read from right to left 56), by 121 is a palindrome. Another example: For 10 decimal number 87: STEP1: 87+78 = 165 STEP2: 165+561 = 726 STEP3: 726+627 = 1353 STEP4: 1353+3531 = 4884 step here is to a N band in addition, the patients received at least step 4 with a palindrome 4884. Write a program that, given a N (2 < = N < = 10 or N = 16) hexadecimal number of M, after seeking at least steps can be palindromes.
例如:给定一个10进制数56,将56加65(即把56从右向左读),得到121是一个回文数。
又如:对于10进制数87:
STEP1:87+78 = 165
STEP2:165+561 = 726
STEP3:726+627 = 1353
STEP4:1353+3531 = 4884
在这里的一步是指进行了一次N进制的加法,上例最少用了4步得到回文数4884。
写一个程序,给定一个N(2<=N<=10或N=16)进制数M,求最少经过几步可以得到回文数。
-If a number (the first non-zero) reading from left to right and from right to left the same time, we will call it palindrome. For example: Given a 10-decimal number 56, will be 56 plus 65 (that is read from right to left 56), by 121 is a palindrome. Another example: For 10 decimal number 87: STEP1: 87+78 = 165 STEP2: 165+561 = 726 STEP3: 726+627 = 1353 STEP4: 1353+3531 = 4884 step here is to a N band in addition, the patients received at least step 4 with a palindrome 4884. Write a program that, given a N (2 < = N < = 10 or N = 16) hexadecimal number of M, after seeking at least steps can be palindromes.
相关搜索: 回文数
(系统自动生成,下载前可以参看下载内容)
下载文件列表
we.doc
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.