我只能说,这个题有毒,就一个空格问题,能卡半天。
AC代码:
#include<iostream>
using namespace std;
int main()
{
int m,n,a,b,c;
while(cin>>m>>n)
{
int count=0;
for(int i=m;i<=n;i++)
{
a=i/100;
b=i%100/10;
c=i%10;
if(a*a*a+b*b*b+c*c*c==i)
{
if(count!=0)
cout<<" ";
count++;
cout<<i;
}
}
if(count==0)
cout<<"no";
cout<<endl;
}
}