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 ...
随机推荐
- Linux下cpu过高问题排查
原文地址:https://blog.csdn.net/chenjunan888/article/details/80447800 在服务器报cpu过高时,可使用以下命令,快速导出堆栈信息,以方便查看具 ...
- window服务 调试步骤
方法一: 1.编译windows服务项目工程 2.把服务注册到系统服务上 3.在visual studio 编辑器中,打断点,用 Debug 进程调试 方法二: 在Onstart 方法中,加上 De ...
- Andriod 简介
Andriod系统采用分层架构,分为4层: 应用程序层(Applications) 包含所有安装在手机上的应用程序(包括系统自带的程序) 应用程序框架层(Application Framework) ...
- 初学web前端,掌握这些就足够了!
Web开发如今是如日中天,热的发烫.那我们应该怎么学习呢?这不光是初学者,很多学了几年的人也会有些迷茫或者彷徨,大家也都知道不断学习是不可避免的,不学习肯定要掉队:那怎么学效率更高,那些是坑,那些是路 ...
- ubuntu 下service php5-fpm restart 报错 stop: Unknown instance: 解决
问题描述: 在安装完扩展后,重启php-fpm,发现一直停止报错 stop: Unknown instance: 通过查看进程,也查询不到该主进程 解决办法: 干掉现在正在执行的进程 pkill ph ...
- vue路由导航守卫及前置后置钩子函数参数详解
首先构建一个测试demo如下图: 接着来探讨路由配置界面 import Vue from 'vue' import Router from 'vue-router' // import HelloWo ...
- SQLite – HAVING 子句
SQLite – HAVING子句 HAVING使您能够指定过滤条件哪一组结果出现在最终的结果. WHERE子句的地方条件选定的列, 在有HAVING 子句的地方 就有GROUP BY子句包含的条件组 ...
- 在Eclipse中通过JDBC连接MySQL步骤,非常详细!
通过JDBC连接MySQL基本步骤代码讲解步骤可能遇到的Bug基本步骤JDBC访问MySQL 1.加载JDBC驱动器—>哪个project需要,就添加到该project的jdbc文件夹下,我的j ...
- easyui实现增删改查
陈旧的开发模式 美工(ui工程师:出一个项目模型) java工程师:将原有的html转成jsp,动态展示数据 缺点: 客户需要调节前端的展示效果 解决:由美工去重新排版,重新选色. 前后端分离: 前端 ...
- MFC_综述
第一天(win消息机制.SDK编程基础) 1.基本概念介绍(SDK.API.句柄.消息队列.winmain函数) 2.第一个Windows界面程序(winAPI) 3.消息循环和窗口 ...