竞赛
考级
#include<bits/stdc++.h> using namespace std; int main(){ int n,a,b,c; cin>>n; for(int i=100;i<=n;i++){ a=i%10; b=i/10%10; c=i/100; if(pow(a,3)+pow(b,3)+pow(c,3)==i){ cout<<i<<endl; } } }
菜
对方正在输入...
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; for(int i=100;i<=n;i++){ int x=i%10,y=i/10%10,z=i/100; if(pow(x,3)+pow(y,3)+pow(z,3)==i){ cout<<i<<endl; } } return 0; }
张高纶
1ntrEstingด้้้้้
WA君
windows🐱💻
YuQing1919
编程的ikun
dchk-SY
正在减肥的吃货
#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; }
1+1=2
枫岚
有事找大号
#include <iostream> #include <cmath> using namespace std; int main(){ int n; int x,a,b,c; cin>>n; for(int i=100;i<=n;i++){ a=i/100; b=i/10%10; c=i%10; if(pow(a,3)+pow(b,3)+pow(c,3)==i) cout<<i<<endl; } return 0; }
王小鑫
acgoacgo
共37条