java中輸入直角三角形的兩條邊長?
import java.util.Scanner;public class ThirdBian { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("請輸入第一條直角邊的邊長:"); Scanner it = new Scanner(System.in)
; int s1=it.nextInt()
; System.out.println("請輸入第二條直角邊的邊長:")
; int s2=it.nextInt()
; System.out.println("所求直角三角形斜邊邊長為"+Math.sqrt(s1*s1+s2*s2)); }}