C++算法代码:
#include<iostream>
using namespace std;
const int N = 100010;
int main()
{
int num1,num2;
bool flag;
cin >> num1 >> num2;
for(int i = num1;i <= num2;i ++)
{
int n = i;
int result = 0;
while(n > 0)
{
result += (n % 10) * (n % 10) * (n % 10);
n = n / 10;
}
if(result == i)
{
printf("%d ",result);
flag = true;
}
}
if(flag == false) printf("no");
return 0;
}