OJ-Problems-Source/HDOJ/2007_autoAC.cpp
2016-08-19 16:52:35 +08:00

20 lines
388 B
C++

#include <stdio.h>
int main(void)
{
unsigned int m, n, i, x, y;
while (scanf("%u%u", &m, &n) != EOF)
{
if (m > n)
{
i = n;
n = m;
m = i;
}
x = y = 0;
for (i = m ; i <= n ; i++)
(i & 1) ? (y += i*i*i) : (x += i*i);
printf("%u %u\n", x, y);
}
return 0;
}