平方和与立方和
摘要:
#include<stdio.h>int main( ){ int N,M,i; while(scanf("%d%d",&N,&M)!=EOF) { int t1=0,t2=0; if( N > M ) N ^= M ^= N ^= M; for(i=N;i<=M;i++) if(i%2) t1+=i*i*i; else t2+=i*i; printf("%d %d\n",t2,t1);}return 0;} 这么简单的一道题,提交 wrong answer..打击啊。。立哥说要判断N是否大于M??一改就对啦。 阅读全文
posted @ 2011-04-28 12:19 more think, more gains 阅读(164) 评论(0) 推荐(0)