文章
40
粉丝
512
获赞
99
访问
396.0k
 
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,m;
    while(cin>>m>>n){
        if(n==0&&m==0){
            break;
        }
        bool flag = false;
        for(int i=m;i<=n;i++){
            int temp=i;
            int a = temp % 10;
            temp /= 10;
            int b=temp % 10;
            temp /= 10;
            int c=temp;
            if(a*a*a+b*b*b+c*c*c == i){
                cout<<i<<" ";
                flag=true;
            }
        }
        if(!flag){
            cout<<"no"<<endl;
        }else{
            cout<<endl;
        }
    }
}
登录后发布评论
暂无评论,来抢沙发