如果这些数字的总和大于20,求出第一个数的平方和第二个数的立方。将结果显示在屏幕上。

编写一个程序,在输入时获得两个参数-数字x和y。如果这些数字的总和大于20,求出第一个数的平方和第二个数的立方。将结果显示在屏幕上。

public class Test{
  public static void main(String []args)
  {
        Scanner sc = new System.out.Scanner();
        int x = sc.nextInt();
        int y = sc.nextInt();
        if(x+y>20)
        {
            System.out.println(x*x);
            System.out.println(y*y*y);
        }
  }

}