#include <stdio.h>
#include <stdlib.h>int main()
{int m,n,i;long long int sum1=0,sum2=0;scanf("%d %d",&m,&n);for(i=m; i<=n; i++){if(i%2==0){sum1+=i*i;}if(i%2!=0){sum2+=i*i*i;}}printf("%lld %lld",sum1,sum2);return 0;
}
详细解决方案
【1343】平方和与立方和
热度:70 发布时间:2023-12-06 09:57:38.0