HDU 2007

时间:2023-11-22 18:01:02
/*杭电ACM ID:2007*/
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
int in1, in2, out1, out2;
int temp = 0, min, max;
while (scanf("%d %d", &in1, &in2) != EOF){
if (in1 < in2){
min = in1;
max = in2;
}
else{
min = in2;
max = in1;
}
temp = min;
out1 = 0;
out2 = 0;
for (; temp <= max; temp++){
if (temp % 2 == 0){
out1 += temp*temp;
}
else{
out2 += temp*temp*temp;
}
}
printf("%d %d\n", out1, out2);
}
}

  是否正确有待验证