hdoj 2010
来源:互联网 发布:上海网络推广铭心科技 编辑:程序博客网 时间:2024/06/05 15:28
#include<iostream>
using namespace std;
int main(void)
{
bool is_sx(int);
int m, n, i;
while(cin>>m>>n)
{
bool exist = false;
for(i = m; i <= n; i++)
{
if(is_sx(i))
{
if(exist) cout<<" ";
exist = true;
cout<<i;
}
}
if(exist) cout<<endl;
else cout<<"no"<<endl;
}
return 0;
}
bool is_sx(int num)
{
int g, s, b;
b = num / 100;
s = num / 10 % 10;
g = num % 10;
if(g * g * g + s * s * s + b * b * b == num) return true;
else return false;
}
using namespace std;
int main(void)
{
bool is_sx(int);
int m, n, i;
while(cin>>m>>n)
{
bool exist = false;
for(i = m; i <= n; i++)
{
if(is_sx(i))
{
if(exist) cout<<" ";
exist = true;
cout<<i;
}
}
if(exist) cout<<endl;
else cout<<"no"<<endl;
}
return 0;
}
bool is_sx(int num)
{
int g, s, b;
b = num / 100;
s = num / 10 % 10;
g = num % 10;
if(g * g * g + s * s * s + b * b * b == num) return true;
else return false;
}
阅读全文
0 0
- HDOJ 2010
- [hdoj]2010
- HDOJ--2010
- hdoj 2010
- HDOJ 2010 水仙花数
- hdoj 2010 水仙花数
- HDOJ 2010 水仙花数
- HDOJ 2010 水仙花数
- HDOJ 2010-水仙花数
- HDOJ 2010 水仙花数
- HDOJ-2010 水仙花数
- HDOJ 2010 水仙花数
- HDOJ
- hdoj
- hdoj
- HDOJ
- HDOJ 【C】 2010 水仙花数
- hdoj.2010 水仙花数 20140721
- quick cocos2dx 自定义事件管理器
- QLabel中html标签的使用
- SonicOperator之实验2
- SonicOperator之结论
- [SpringMVC] SpringMVC注解
- hdoj 2010
- Hadoop之HDFS(三)
- 简单了解Java本身是怎样判断一个文件是目录
- HDU1559 最大子矩阵【DP】
- c#处理3种json数据的实例
- hdoj 2011
- QLabel设置行间距
- HTML DOM之节点操作方法(2)
- hdoj 2012