水仙花数
来源:互联网 发布:淘宝快递助手在哪订购 编辑:程序博客网 时间:2024/04/28 21:23
编写程序,求100~999之间所有的水仙花数。所谓“水仙花数”,
即是一个三位数,它个位、十位、百位数字的立方和,恰好等于该数本身。
#include<stdio.h>void main(){int i,a,b,c;for(i=100;i<=999;i++){a=i/100;b=i/10-a*10;c=i%10;if(a*a*a+b*b*b+c*c*c==i){//printf("%d %d %d\n ",a,b,c );printf("%d\n",i);}}}
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- sublime text 显示中文乱码
- mysql的1067错误 - 2
- C#基础-C#数据结构,集合
- 阶乘的精确值!
- Sample 4.2:string.cpp
- 水仙花数
- linux shell基础命令
- Sample 4.3:instr1.cpp
- 允许用户输入的插入排序
- (+)2013年11月交易总结(9天)(4.54)(第一个盈利月,庆祝一下,加油!!!)
- jvm详解-概览
- Sample 4.4:instr2.cpp
- Windows 8令人担忧:8和8.1两版本份额目前仅有9.3%
- JQuery运行机制及原理