标签:des style blog http color java os io
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 90266 Accepted Submission(s): 28902
#include<stdio.h> int main(){ int m=0, n=0, i=0, resulto=0, resulte=0; while(scanf("%d%d", &m, &n)!=EOF){ for(i=m; i<=n; i++){ if(i%2){ resulto= resulto+i*i*i; } else{ resulte=resulte+i*i; } } printf("%d %d\n", resulte, resulto); resulte=resulto=0; } return 0; }
third try:accepted
#include<stdio.h> int main(){ int m=0, n=0, i=0, resulto=0, resulte=0, temp=0; while(scanf("%d%d", &m, &n)!=EOF){ if(m>n){ temp=m; m=n; n=temp; } for(i=m; i<=n; i++){ if(i%2){ resulto= resulto+i*i*i; } else{ resulte=resulte+i*i; } } printf("%d %d\n", resulte, resulto); resulte=resulto=0; } return 0; }
马上就要大三了。却还做着别人大一做的事情,还做不好。
要细心。多练习。加油。
标签:des style blog http color java os io
原文地址:http://www.cnblogs.com/comeonleo/p/3896086.html