HDU平方和与立方和
#include <stdio.h>
int main() {
int m,n,a;
int x = 0;
int y = 0;
while(scanf("%d%d",&m,&n) != EOF){
if(m>=n){
a = n;
n = m;
m = a;
}
for(;m<=n;m++){
if(m%2 != 0){
x = x + m*m*m;
}
else{
y = y + m*m;
}
}
printf("%d %d\n",y,x);
x = 0;
y = 0;
}
return -1;
}
来源:CSDN
作者:CreatorZhou
链接:https://blog.csdn.net/im_rookie/article/details/103482106