#include<stdio.h>
int main()
{
int m,n,i,t;
while(scanf("%d%d",&m,&n)!=EOF)
{
int s1=0,s2=0;
if(m>n) //注意要使m<n;
{t=m;m=n;n=t;}
for(i=m;i<=n;i++)
{
if(i%2==0)
s 1=s1+i*i;
if(i%2!=0)
s2=s2+i*i*i;
}
printf("%d %d\n",s1,s2);
}
return 0;
}
原文:http://www.cnblogs.com/gongpulin/p/3876442.html