6.10水仙花数
来源:互联网 发布:黄石淘宝运营招聘 编辑:程序博客网 时间:2024/06/08 03:12
#include <stdio.h>#include <stdlib.h>int main(){ int i,a,b,c; for(i=100;i<=1000;i++) { a=i%10;//计算个位上的数 b=(i/10)%10;//计算十位上的数 c=i/100;//计算百位上的数 if(i==a*a*a+b*b*b+c*c*c) printf("%d\n",i); } return 0;}
运行结果如下:
知识点:
学会分离一个数的个位、十位与百位。
阅读全文
0 0
- 6.10 水仙花数
- 6.10 水仙花数
- 6.10水仙花数
- 6.10水仙花数
- 6.10水仙花数
- 6.10水仙花数
- 6.10水仙花数
- 6.10水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- shiro学习之路-加密模块
- Python学习记录总结
- 流程控制
- PAT乙级1004. 成绩排名 (20)
- MyBatis-plus在eclipse中的使用详解
- 6.10水仙花数
- 为什么某些Win32技术在Windows NT服务中行为不当?
- 一日一文(8)
- 张小龙分享的产品经验
- 设置yum国内的镜像站点
- FSE 2017 Understanding Misunderstandings in Source Code 阅读笔记
- 基于JavaMail的Java邮件发送:简单邮件发送
- 树莓派配置软件源(一共两个)
- Java基础——集合