小南解题-- [编程入门]水仙花数判断--54ms
摘要:b=[]for i in range(100,1000): i=str(i) if (int(i[0])**3+int(i[1])**3+int(i[2])**3)==int(i): ……
1016——————水仙花数判断
摘要:充分理解概念:**水仙花数"是指一个三位数 其各位数字立方和等于该本身**
for i in range(100,1000):
#三位数
if (int(str(i……
"水仙花数判断"题解
摘要:解题思路:要判断一个数是不是水仙花数,就是在判断它的百、十、个位的立方是否等于它本身。要取一个数的百、十、个位:百:x/100;十:x%100/10;个:x%10.立方可以调用math.h库中的pow……
1016-水仙花数判断 语言:C++
摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cmath>using namespace std;int main(){ int a,b,c=3; ……
题目 1016: [编程入门]水仙花数判断—常规求解方法
摘要:解题思路:while循环注意事项:指数用pow函数或者其他形式参考代码:#include<stdio.h>
#include<math.h>
int main(void)
{
int i……
编写题解 1016: [编程入门]水仙花数判断
摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a,b,c,i; for(i=100;i<=999;i++) { a=i/100; b=i/10%1……