ZOJ 2736 Daffodil number
来源:互联网 发布:网络项目传销名单 编辑:程序博客网 时间:2024/05/16 04:24
E - Daffodil number
Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluDescription
The daffodil number is one of the famous interesting numbers in the mathematical world. A daffodil number is a three-digit number whose value is equal to the sum of cubes of each digit.
For example. 153 is a daffodil as 153 = 13 + 53 + 33.
Input
There are several test cases in the input, each case contains a three-digit number.
Output
One line for each case. if the given number is a daffodil number, then output "Yes", otherwise "No".
Sample Input
153
610
Sample Output
Yes
No
代码:
#include<iostream>using namespace std;int main(){ int n; int a,b,c; while(cin>>n) { a=n%10; b=(n/10)%10; c=n/100; if(a*a*a+b*b*b+c*c*c==n) cout<<"Yes"<<endl; else cout<<"No"<<endl; } return 0;}
0 0
- zoj 2736 Daffodil number
- ZOJ 2736 Daffodil number
- ZOJ Problem Set - 2736 Daffodil number
- ZOJ Problem Set - 2736 Daffodil number
- zoj_2736 Daffodil number
- daffodil
- ZOJ 1039 Number Game
- zoj 1526 Big Number
- ZOJ 2829 Beautiful Number
- zoj 2105 Number Sequence
- zoj 1526 Big Number
- zoj 3327 Friend Number
- ZOJ - 3180 Number Game
- ZOJ 3543 Number String
- zoj 2829 Beautiful Number
- zoj 2284 Inversion Number
- zoj 1414 Number Steps
- zoj 1039 Number Game
- hadoop生态系统学习之路(五)hbase的简单使用
- 关于HashMap的ContainsKey()
- Code resource ✵1
- 解决Attribute "rippleColor" has already been defined的问题
- leetcode_154 Find Minimum in Rotated Sorted Array II
- ZOJ 2736 Daffodil number
- 【bzoj2022】弹飞绵羊
- python疑难杂症
- Android 的 SDK Manager 无法启动 闪退解决方法
- struts2工作流程
- 区块链技术资料
- WCF分分钟入门
- mysql命名规范
- 二师弟的星际加法