HDU/2007/main.c
Saturneric 0525ffad24 Add.
2020-09-01 00:48:58 +08:00

24 lines
393 B
C

#include <stdio.h>
#define TWQ(x) ((x)*(x))
#define THQ(x) ((x)*(x)*(x))
#define ABS(x) ((x)>0?(x):(-(x)))
int main(void){
int m = 0, n = 0;
while(scanf("%d %d",&m,&n) == 2){
long o = 0,j = 0;
int i = 0;
if(m > n){
i = m;
m = n;
n = i;
}
for(i = m ; i <= n; i++)
if(ABS(i) % 2) j += THQ(i);
else o += TWQ(i);
printf("%ld %ld\n",o,j);
getchar();
}
return 0;
}