3497. 水仙花数
来源:互联网 发布:淘宝店铺被投诉会怎样 编辑:程序博客网 时间:2024/04/24 02:07
3497. 水仙花数
Description
若三位数ABC满足ABC=A3+B3+C3,则称ABC为水仙花数. 例如153就是一个水仙花数. 编程找出100~999范围内的所有水仙花数.
Input
无
Output
输出所有水仙花数,每个水仙花数占一行.
Problem Source
林瀚
// source code of submission 955534, Zhongshan University Online Judge System#include <iostream>using namespace std;int main (){ for (int num = 100;num <= 999;num ++) { int a = num / 100; int b = (num % 100) / 10; int c = ((num % 100) % 10); if (a*a*a+b*b*b+c*c*c == num) cout << num << endl; } return 0;}
- 3497. 水仙花数
- 3497. 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 水仙花数
- 数学计算-圆周率计算算法
- 动态规划解决0-1背包问题
- IE7 0day漏洞分析
- ZOJ1005
- [USACO 1.5] Summary of Section 1.5
- 3497. 水仙花数
- 第一章Java概述及开发环境搭建
- 3496. 鸡兔同笼
- MySQL的Join使用
- 2683. Alice and Bob
- qualcomm android 方案的wifi 方案选择
- 教你如何正确的运用百度百科
- Android界面组件
- 关于9patch的工具