HW2.22

时间:2022-12-09 16:21:56

HW2.22

 import java.util.Scanner;

 public class Solution
 {
     public static void main(String[] args)
     {
         Scanner input = new Scanner(System.in);

         System.out.print("Enter the side: ");
         double side = input.nextDouble();

         input.close();

         double area = 3 * Math.pow(3, 0.5) * side * side / 2;

         System.out.println("The area of the hexagon is " + area);
     }
 }

相关文章