Problem description Given a continuous number of integers, the sum of all the even squares of all of them, and all the odd cubes.
Input
The input data contains multiple sets of test instances, each containing a row consisting of two integers m and N.
Output
For each set of input data, the output line should consist of two integers x and y, representing the sum of all the even squares of the consecutive integers in that segment and all the odd cubic and.
You can assume that a 32-bit integer is sufficient to save the result.
Sample Input
1 32 5 Code implementation:
1#include <stdio.h>2#include <math.h>3 intMain ()4 {5 intM,n,a,b,temp,i=0;6 while(SCANF ("%d%d", &m,&n)! =EOF)7 {8A=0; b=0;9 if(m>n) {temp=m;m=n;n=temp;}Ten for(i=m;i<=n;i++) One { A if(i%2==0) a=a+i*i; - Else -b=b+i*i*i; the } -printf"%d%d\n", A, b); - } + return 0; -}
1. To consider the size of the input m, n
hdoj2007-Squared and Cubic and