fm2015 中后卫 小球会:多边行周长的求法,请问哪错了?
来源:百度文库 编辑:高考问答 时间:2024/05/27 09:57:11
#include <stdio.h>
#include <math.h>
#define PI 3.1415926
void main()
{
unsigned float s,n,h;
printf("输入边和高:\n");
scanf("%f%f",&n,&h);
s=(n*h*h)/(tan(PI/2-PI/n));
printf("%f",s);
}
#include <math.h>
#define PI 3.1415926
void main()
{
unsigned float s,n,h;
printf("输入边和高:\n");
scanf("%f%f",&n,&h);
s=(n*h*h)/(tan(PI/2-PI/n));
printf("%f",s);
}