1 import java.util.Scanner; 2 3 public class Solution 4 { 5 public static void main(String[] args) 6 { 7 Scanner input = new Scanner(System.in); 8 9 System.out.print("Enter the length of side: "); 10 double side = input.nextDouble(); 11 12 input.close(); 13 14 System.out.println(getArea(side)); 15 } 16 17 public static double getArea(double side) 18 { return 5 * side * side / ( 4 * Math.tan(Math.PI / 5)); } 19 }
时间: 2024-11-08 23:50:20