标签:clu ret ios count code i++ math.h stream logs
http://acm.hdu.edu.cn/showproblem.php?pid=2010
#include<iostream> #include<stdio.h> #include<math.h> #include<queue> #include<stack> #include<algorithm> #define PI 3.1415927 using namespace std; int main() { int m,n; while(scanf("%d%d",&m,&n)!=EOF) { int a,b,c,i,count=0; for(i=m;i<=n;i++) { /*count=0;若count放在这里,则到最后count的值仍为0 所以跳出for循环后继续打印no*/ a=i/100; b=i%100/10; c=i%10; if(i==a*a*a+b*b*b+c*c*c) { if(count>0) printf(" "); printf("%d",i); count++; } } if(count==0) printf("no\n"); else printf("\n"); } return 0; }
标签:clu ret ios count code i++ math.h stream logs
原文地址:http://www.cnblogs.com/hhkobeww/p/7467629.html