import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
while(sc.hasNext()){
int x=0;
int y=0;
int n=sc.nextInt();
int m=sc.nextInt();
if(n>m)
{
int temp=n;
n=m;
m=temp;
}
for(;n<=m;n++)
{
if(n%2==0)
{
x=x+(n*n);
}
else
{
y=y+(n*n*n);
}
}
System.out.println(x+" "+y);
}
}
}
杭电 2007 ( 平方和与立方和 ) java
最新推荐文章于 2020-11-22 11:09:20 发布