zoj 2736 Daffodil number
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的更多相关文章
- ZOJ 3622 Magic Number 打表找规律
A - Magic Number Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Subm ...
- ZOJ 3436 July Number(DFS)
题意 把一个数替换为这个数相邻数字差组成的数 知道这个数仅仅剩一位数 若最后的一位数是7 则称原来的数为 July Number 给你一个区间 求这个区间中July Number的个数 ...
- ZOJ 3233 Lucky Number
Lucky Number Time Limit: 5000ms Memory Limit: 32768KB This problem will be judged on ZJU. Original I ...
- [ZOJ 3622] Magic Number
Magic Number Time Limit: 2 Seconds Memory Limit: 32768 KB A positive number y is called magic n ...
- ZOJ 3622 Magic Number(数)
题意 假设一个正整数y满足 将随意正整数x放到y的左边得到的数z满足 z%y==0 那么这个数就是个Magic Number 给你一个范围 求这个范围内Magic Number的个数 令 ...
- zoj 1526 Big Number 数学
Big Number Time Limit: 10 Seconds Memory Limit: 32768 KB In many applications very large intege ...
- ZOJ 3886 Nico Number(筛素数+Love(线)Live(段)树)
problemCode=3886">ZOJ 3886 题意: 定义一种NicoNico数x,x有下面特征: 全部不大于x且与x互质的数成等差数列,如x = 5 ,与5互素且不大于5的数 ...
- ZOJ 3690 Choosing number(矩阵)
Choosing number [题目链接]Choosing number [题目类型]矩阵 &题解: 这题就和已经dp极像了,所以找方程就很困难了.可以这样找: 设f(n)是前n-1个人已经 ...
- 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 ...
随机推荐
- 使用statement接口实现增,删,改操作
- D. Taxes 哥德巴赫猜想
http://codeforces.com/contest/735/problem/D 这题其实我还不是很懂,那个只是猜想,然而却用了. 只想说说找到第一小于n的素数这种思路是不行的. 121 = 1 ...
- Apache Kylin Cube 的构建过程
不多说,直接上干货! 1. Cube的物理模型 Cube物理模型 如上图所示,一个常用的3维立方体,包含:时间.地点.产品.假如data cell 中存放的是产量,则我们可以根据时间.地点.产品来确定 ...
- 浅谈 echarts 用法
对于服务型的公司来说,需要了解用户的使用趋势,来帮助分析市场的走向,所以说统计在一个管理后台中是必不可少的. 会用到echarts插件 ,其官网网址 http://echarts.baidu.com/ ...
- Log4net系列二:Log4net邮件日志以及授权码
Log4net邮件发送 上篇文章我们主要介绍Log4net生成文本格式,本篇文章主要配置邮箱发送.关于项目的引用,搭建我们就不在描述,如果不太清楚,请看上篇文章, 老规矩,我们现在配置文件中添加一个a ...
- this关键字实现串联构造函数调用
在一个类中如果需要实现多个自定义构造函数,通常做法是在构造函数中实现各自的业务逻辑,如果这些业务逻辑的实现并非截然不同的话,显然不符合oop编程思想,极不利于维护,当然,我们也可以通过将相同的逻辑部分 ...
- [ Luogu 3709 ] 大爷的字符串题
\(\\\) Description 原题题面太过混乱出题人语文凉凉 给出一个长为 \(n\) 的数列 \(A\) ,多次询问: 对于一个区间 \([L_i,R_i]\),把区间内的所有数最少划分成多 ...
- Android单独继承View类来实现自定义控件
一个单独继承view类来实现自定义控件,在该方法中,需要重写ondraw方法来绘制自己所需要的控件,下面也以一个简单的例子来说明如何实现自定义控件.该方法可以实现所需要的所有的自定义控件. 属性文件中 ...
- Keil简介
最早接触Keil是学习开发8051系列的单片机.Keil C51是Keil公司出品的51系列兼容单片机C语言软件开发系统,与汇编相比,C语言在功能上.结构性.可读性.可维护性上有明显的优势,因而易学易 ...
- IOS OS X 中集中消息的传递机制
1 KVO (key-value Observing) 是提供对象属性被改变是的通知机制.KVO的实现实在Foundation中,很多基于 Foundation 的框架都依赖与它.如果只对某一个对象的 ...