没有判断n是否大与m,下面是我的代码:好久没上杭电刷题了#includeint main(){int a,b,e,f,t;while(scanf("%d %d",&a,&b)!=EOF){ if(a>b) {t=a;a=b;b=t;} for(e=0,f=0;a<=b;a++){if(a%2!=0) e=e+a*a*a;else f=f+a*a;}printf("%d %d\n",f,e);}return 0;}