2010 水仙花

#include <iostream>
using namespace std;
int main()
{
int m,n,a,b,c,d;
while(cin>>m>>n)
{
d=0;
while(m<=n)
{
a=m%10;
           b=(m%100)/10;
           c=m/100;


if(a*a*a+b*b*b+c*c*c==m)
{
if(d==0)
cout<<m;
else
cout<<' '<<m;
d++;
}
m++;
}
if(d==0)
cout<<"no"<<endl;
else
cout<<endl;
}
return 0;

}


做题细心 不会的多练 重复几十次


猜你喜欢

转载自blog.csdn.net/qq_32522799/article/details/50211981