文章
105
粉丝
69
获赞
117
访问
57.4k
#include <bits/stdc++.h>
using namespace std;
int n, m;
bool cheak(int x)
{
int a = x / 100;
int b = (x / 10) % 10;
int c = x % 10;
return a * a * a + b * b * b + c * c * c == x;
}
int main()
{
while(cin >> n >> m, n, m)
{
bool t = true;
for(int i = n; i <= m; i ++)
if(cheak(i)) t = false, cout << i << " ";
if(t) cout << "no";
cout << endl;
}
return 0;
}
登录后发布评论