Disarium Number(特殊号码系列#3)【难度:1级】--景越Python编程训练之挑战1000道Python面试题(含答案)
作者:互联网
Disarium Number(特殊号码系列#3)【难度:1级】:
#Definition
** _ Disarium number _ **是用其各自位置驱动的数字总和等于数字本身的数字。
#任务
** 给 一个数字, _查找它是否是Disarium _ **。
#热身(强烈推荐)
#[玩数字系列](https://www.codewars.com/collections/playing-with-numbers)
#Notes
- ** 传递的数字 ** 总是 ** 正 **。
- ** 返回 ** 结果为 ** _ String _ **
#Input >>输出示例
1- disariumNumber(89)==>返回“Disarium !!”
** 解释 **:
因为,* _ 8 1 </ sup> + 9 2 </ sup> = 89 _ **,因此输出是“Disarium !!”
2- disariumNumber(564)==>返回“不!!”
** 解释 **:
因为,** _ 5 1 </ sup> + 6 2 </ sup> + 4 3 </ sup> = 105!= 546 _ **,因此输出是“不! !“`
#[玩数字系列](https://www.codewars.com/collections/playing-with-numbers)
#[使用列表/数组矩阵系列](https://www.codewars.com/collections/playing-with-lists-slash-arrays)
#[更加愉快的Katas](http://www.codewars.com/users/MrZizoScream/authored)
##欢迎所有翻译
##享受学习!!
#Zizou
英文原题:
Definition
Disarium number is the number that The sum of its digits powered with their respective positions is equal to the number itself.
Task
Given a number, Find if it is Disarium or not .
Warm-up (Highly recommended)
Playing With Numbers Series
Notes
- Number passed is always Positive .
- Return the result as String
Input >> Output Examples
1- disariumNumber(89) ==> return "Disarium !!"
Explanation:
- Since , 81 + 92 = 89 , thus output is
"Disarium !!"
2- disariumNumber(564) ==> return "Not !!"
Explanation:
Since , 51 + 62 + 43 = 105 != 546 , thus output is "Not !!"
Playing with Numbers Series
Playing With Lists/Arrays Series
For More Enjoyable Katas
ALL translations are welcomed
Enjoy Learning !!
Zizou
最佳答案合集(多种解法):
更多关联题目:
单词搜索网格【难度:3级】–景越Python编程训练之挑战1000道Python面试题(含答案)
Krazy King二十一点【难度:3级】–景越Python编程训练之挑战1000道Python面试题(含答案)
免责申明:
本博客所有编程题目及答案均收集自互联网,主要用于供网友学习参考,如有侵犯你的权益请联系管理员及时删除,谢谢
标签:面试题,景越,Python,number,89,www,sup,Disarium 来源: https://blog.csdn.net/aumtopsale/article/details/98090299