标签:put names title cout NPU ++ i++ 立方和 杭电
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 268130 Accepted Submission(s): 75246
1 #include<iostream> 2 using namespace std; 3 int main() 4 { 5 int a,b,c,num,i; 6 while(cin>>a>>b) 7 { 8 int d=0,e=1; 9 for(i=a;i<=b;i++) 10 { 11 num=i; 12 int sum=0; 13 while(num) 14 { 15 c=num%10; 16 num/=10; 17 sum+=c*c*c; 18 } 19 if(sum==i) 20 { 21 if(e==1) 22 { 23 e=0; 24 cout<<i; 25 } 26 else cout<<" "<<i; 27 d=1; 28 } 29 } 30 if(d==0)cout<<"no"; 31 cout<<endl; 32 } 33 return 0; 34 }
标签:put names title cout NPU ++ i++ 立方和 杭电
原文地址:https://www.cnblogs.com/lightice/p/10261123.html