Daffodil number


Time Limit: 2 Seconds      Memory Limit: 65536 KB

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>
#include <cstdio>
using namespace std;
int main(){
int n, a, b, c;
while(cin >> n){
a = n / ;
b = n % / ;
c = n % ;
if(n == a * a * a + b * b *b + c * c * c)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return ;
}

最新文章

  1. 广州PostgreSQL用户会技术交流会小记 2015-9-19
  2. nodejs-helloword案例
  3. poj1703 并查集
  4. 未来十年的十三条思考(FW)
  5. JPA学习---第十一节:JPA中的多对多双向关联实体定义与注解设置及操作
  6. SpringMVC + Spring + MyBatis 学习笔记:在类和方法上都使用RequestMapping如何访问
  7. IE下判断IE版本语法使用
  8. The kth great number(set)
  9. Ubuntu配置eclipse
  10. linux pagecache与内存占用
  11. PHP中的抽象类与抽象方法/静态属性和静态方法/PHP中的单利模式(单态模式)/串行化与反串行化(序列化与反序列化)/约束类型/魔术方法小结
  12. 深挖 NPM 机制
  13. SpringCloud Ribbon的分析(二)
  14. 通信导论-IP数据网络基础(4)
  15. 使用海康的某款摄像头以及v4l2的经验
  16. Intellij IDEA使用Docker插件部署应用
  17. Lazarus 初识
  18. 印象深刻的bug
  19. Java反射、动态加载(将java类名、方法、方法参数当做参数传递,执行方法)
  20. C#知识点提炼期末复习专用

热门文章

  1. java自带线程池
  2. (024)[工具软件]截屏录屏软件FSCapture(转)
  3. RHEL7.2安装及配置实验环境
  4. 基于pymysql模块的增删改查
  5. 架包Error inflating class错误
  6. java 读取txt,java读取大文件
  7. HDU 5416 CRB and Tree (技巧)
  8. codevs 3070 寻找somebody4(水题日常)
  9. javaee 第11周
  10. Python100天打卡-Day10-图形用户界面和游戏开发