不会这个题
输入2个整数,求两数的平方和并输出。
输入2个整数,求两数的平方和并输出。
2019-03-20
import java.util.Scanner;
double sum=0;
Scanner sc = new Scanner(System.in);
System.out.println("please input the first number: ");
double num1 = sc.nextDouble();
System.out.println("please input the second number: ");
double num2 = sc.nextDouble();
sum = num1*num1 + num2*num2;
System.out.println("sum = " + sum);
举报