#include <cstdio>
#include<iostream>
#include<cmath>
using namespace std;
int num[10];
void init(){
int t;
for(int i=1;i<=9;i++){
t=i;
for(int j=1;j<5;j++){
t*=i;
}
num[i]=t;
}
}
int check(int i){
int anx=i,res=0;
while(i){
res+=num[i%10];
i/=10;
}
return res==anx;
}
int main(){
init(); //下次要记住函数定义但是要去用他
int a=0;
for(int i=11;i<1000000;i++){
if(check(i)){
a+=i;
cout<<i<<endl;
}
}
cout<<a<<endl;
return 0;
}
上界估算
最新推荐文章于 2021-07-27 23:26:20 发布