public class J4_5 {
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 numbe of sizes: ");
int n = input.nextInt();
System.out.print("Enter the size: ");
double s = input.nextDouble();
double area = (n * Math.pow(s, 2)) / (4 *Math.tan(Math.PI/n));
System.out.println("The area of the polygon is :"+area);
}
}
Java语言程序设计(基础篇)第十版 4.5
最新推荐文章于 2022-11-25 10:37:01 发布