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 ;
}

zoj 2736 Daffodil number的更多相关文章

  1. ZOJ 3622 Magic Number 打表找规律

    A - Magic Number Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Subm ...

  2. ZOJ 3436 July Number(DFS)

    题意   把一个数替换为这个数相邻数字差组成的数  知道这个数仅仅剩一位数  若最后的一位数是7  则称原来的数为 July Number  给你一个区间  求这个区间中July Number的个数 ...

  3. ZOJ 3233 Lucky Number

    Lucky Number Time Limit: 5000ms Memory Limit: 32768KB This problem will be judged on ZJU. Original I ...

  4. [ZOJ 3622] Magic Number

    Magic Number Time Limit: 2 Seconds      Memory Limit: 32768 KB A positive number y is called magic n ...

  5. ZOJ 3622 Magic Number(数)

    题意  假设一个正整数y满足  将随意正整数x放到y的左边得到的数z满足 z%y==0  那么这个数就是个Magic Number   给你一个范围  求这个范围内Magic Number的个数 令 ...

  6. zoj 1526 Big Number 数学

    Big Number Time Limit: 10 Seconds      Memory Limit: 32768 KB In many applications very large intege ...

  7. ZOJ 3886 Nico Number(筛素数+Love(线)Live(段)树)

    problemCode=3886">ZOJ 3886 题意: 定义一种NicoNico数x,x有下面特征: 全部不大于x且与x互质的数成等差数列,如x = 5 ,与5互素且不大于5的数 ...

  8. ZOJ 3690 Choosing number(矩阵)

    Choosing number [题目链接]Choosing number [题目类型]矩阵 &题解: 这题就和已经dp极像了,所以找方程就很困难了.可以这样找: 设f(n)是前n-1个人已经 ...

  9. ZOJ 3702 Gibonacci number 2017-04-06 23:28 28人阅读 评论(0) 收藏

    Gibonacci number Time Limit: 2 Seconds      Memory Limit: 65536 KB In mathematical terms, the normal ...

随机推荐

  1. Git命令---递归克隆

    git clone --recursive https://github.com/rbgirshick/fast-rcnn.git Git命令 --recursive 会递归克隆fast-rcnn项目 ...

  2. Web API性能优化(一)压缩

    简单的应用场景:分页获取日志JSON信息. 很简单的实现,简单的记录一下 未压缩时候 使用PostMan请求http://localhost:34390/api/gpm/syslog/page?pag ...

  3. Retrofit Upload multiple files and parameters

    Retrofit 的介绍以及基本使用 这里不再说明. 关于多文件上传 以及上传文件的同时携带多个参数说明 网上涉及到的不是太多. 上一张帅图: 代码: apiService: /** params 参 ...

  4. jQuery选择器之表单元素选择器

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content ...

  5. Es6里面的解析结构

    <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...

  6. fgetpos, fseek, fsetpos, ftell, rewind - 重定位某个流

    总览 (SYNOPSIS) #include <stdio.h> int fseek(FILE *stream, long offset, int whence); long ftell( ...

  7. QT_1

    QT概述 1.1 QT 是一个跨平台的C++图形用户界面应用程序框架 1.2 发展史: 1991奇趣科技 1.3 QT 版本:商业版.开源版 1.4 优点: 1.4.1 跨平台 1.4.2 接口简单 ...

  8. 暑假集训 || 树DP

    树上DP通常用到dfs https://www.cnblogs.com/mhpp/p/6628548.html POJ 2342 相邻两点不能同时被选 经典题 f[0][u]表示不选u的情况数,此时v ...

  9. python⽤户登陆

    ⽤户登陆(三次输错机会)且每次输错误时显示剩余错误次数(提示:使⽤字符串格式化) count = 3 while count < 4: count -= 1 username = input(' ...

  10. devops issue

    1.Nginx(refercence:https://zhuanlan.zhihu.com/p/24382606) summary: DJANGO_PROJECT = /home/django/dja ...