#include<iostream>
#include<cstdlib>
#include<math.h>
#include<string>
#include<algorithm>
#include<sstream>
using namespace std;
int main()
{
int c,d,n;
int a,sum=0,x,r=0;
string str;
while(cin>>c>>d)
{
for(c;c<=d;c++)
{
n=c,x=c;
stringstream ss;
ss<<c;
ss>>str;
int z=str.size();
for(int i=0;i<z;i++)
{
a=pow((n%10),z);
sum=sum+a;
n=n/10;
}
if(sum==x)
{
cout<<x<<" ";
r=1;
}
sum=0;
}
if(r==0)
{cout<<"none"<<endl;
}
cout<<endl;
}
return 0;
}
感謝高手指點