HDU 2007

/*杭电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);
}
}

  是否正确有待验证

上一篇:Centos6.5安装和使用docker


下一篇:linux配置网卡IP地址命令详细介绍及一些常用网络配置命令