求水仙花数

/*  
*Copyright (c) 2013 ,烟台大学计算机学院  
*All rights reserved.  
*作者:王至超  
*完成日期:2013年11月 10
*版本号:v1.0  
*问题描述:无
*样例输入:无
*样例输出:无  
*问题分析:用简单的方法,学会活学活用  
*/  




#include  <iostream>
#include <cmath>
using namespace std;
int main()
{int a,b,c,m,e;
cin>>m;
m=a*100+b*10+c;
e=pow(a,3)+pow(b,3)+pow(c,1);
if(m==e)
{cout<<"为水仙花数"<<endl;}
else
{cout<<"不是水仙花数"<<endl;}
return 0;}
求水仙花数_第1张图片 求水仙花数_第2张图片 求水仙花数_第3张图片

你可能感兴趣的:(求水仙花数)