杭州电子科技大学acm 2010帮我看看我的问题出在哪了
acm吧
全部回复
仅看楼主
level 4
#include
int main(){ int m,n,a,b,c,t,temp; while(scanf("%d %d",&m,&n)!=EOF) { if (m>n) { temp=m; m=n; n=temp; } for(t=0;m<=n;m++) { a=m/100; b=m/10%10; c=m%10; if(m==a*a*a+b*b*b+c*c*c) { printf("%d\040",m); t=t+1; } } if (t==0) printf("no\n"); else printf("\b\n"); } return 0;}
2008年11月02日 07点11分 1
level 0
痛苦!估计是你的输出格式的问题!照你的程序修改后AC了的:#include
#include
using namespace std; int main() { int m,n,a,b,c,t; int array[100]; while(scanf("%d %d",&m,&n)!=EOF) { int temp=0; for(t=m;t<=n;t++) { a=t/100; b=t/10%10; c=t%10; if(t==a*a*a+b*b*b+c*c*c) { array[temp] = t; //cout<
2008年11月02日 13点11分 2
level 0
痛苦,给你修改了能AC的:#include
#include
using namespace std; int main() { int m,n,a,b,c,t; int array[100]; while(scanf("%d %d",&m,&n)!=EOF) { int temp=0; for(t=m;t<=n;t++) { a=t/100; b=t/10%10; c=t%10; if(t==a*a*a+b*b*b+c*c*c) { array[temp] = t; //cout<
2008年11月02日 13点11分 3
1