package 作业;
import java.util.Scanner;
public class 第五次正多边形的面积 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
double b = sc.nextDouble();
System.out.println("The erea of the poylgon is " + erea(a, b));
}
public static double erea(int n,double side)
{
double s;
s=(n*side*side)/(4.0*Math.tan(3.1415926535/n));
return s;
}
}
正多边形的面积
最新推荐文章于 2024-05-11 20:09:51 发布