public class J4_4 {
public static void main(String[] args) {
// TODO Auto-generated method stub
java.util.Scanner input = new java.util.Scanner(System.in);
System.out.print("Enter the side: ");
double size = input.nextDouble();
double area = (6 * Math.pow(size, 2)) / (4 * Math.tan(Math.PI /6));
System.out.printf("The area of the hexagon is %4.2f",area);
}
}
Java语言程序设计(基础篇)第十版 4.4
最新推荐文章于 2022-11-25 10:37:01 发布