自定义函数
2025-07-12 16:41:37
发布于:广东
0阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
bool sxh(int a){
int x=a%10,y=a/10%10,z=a/100;
return a==pow(x,3)+pow(y,3)+pow(z,3);
}
int main(){
int a;
cin>>a;
for(int i=100;i<=a;i++){
if(sxh(i)){
cout<<i<<endl;
}
}
return 0;
}
这里空空如也
有帮助,赞一个