【1135】阿姆斯特朗数
来源:互联网 发布:湖北地税网络纳税 编辑:程序博客网 时间:2024/06/03 22:23
描述:
阿姆斯特朗数又称水仙花数,是指一种三位数,其各个数字之立方和等于该数。
Armstrong number which is also called Daffodils number is a three-figure number,andthe sum of the number of it’s respective positions equals itself.
For example 153 = 1*1*1 + 5*5*5 + 3*3*3
输入:
本题无输入
None
输出:
升序输出
所有阿姆斯特朗数,每个数字占一行。
Output all Armstrong number in ascending order and every integer occupies aline only.
输入样例:
无
None
输出样例:
无
None
#include<iostream>using namespace std;int main(){int i,a,b,c;for(i=100;i<1000;i++){a=i/100;b=(i%100)/10;c=(i%100)%10;if(i==a*a*a+b*b*b+c*c*c){cout<<i<<endl;}}return (0);}
阅读全文
0 0
- 【1135】阿姆斯特朗数
- 阿姆斯特朗数
- 阿姆斯特朗数
- 阿姆斯特朗数。。。。
- 阿姆斯特朗数
- 阿姆斯特朗数
- 阿姆斯特朗数
- 阿姆斯特朗数
- 阿姆斯特朗数
- 阿姆斯特朗数
- 阿姆斯特朗数
- 阿姆斯特朗数
- 阿姆斯特朗数
- 阿姆斯特朗数
- 阿姆斯特朗数
- 阿姆斯特朗数
- 阿姆斯特朗数
- 阿姆斯特朗数--char3
- (转)Python 字符串格式化 (%操作符)
- 阿里巴巴java插件
- HDU3656-Fire station
- android webview 遇到android.os.FileUriExposedException错误
- 338. Counting Bits
- 【1135】阿姆斯特朗数
- Android Studio XListView制作Library
- (2)Xamarin Android 常见问题(不能预览,axml没有智能提示)
- 表格增、查、排序 敏感字、颜色 完美
- luogu P3252 [JLOI2012]树
- NOIP模拟(20171023)T1 fibonacci
- LeetCode.169(229) Majority Element && II
- 为什么Dialog不能用Application的Context
- string和vector易错点