Codeforces C1. Simple Polygon Embedding

https://codeforc.es/contest/1354/problem/C1
(题目链接如上↑)
推导过程:
Codeforces C1. Simple Polygon Embedding_第1张图片
AC代码:

#include 
#include  
#include 
using namespace std;
#define PI 3.141592653589//要比6位多几位
int main(){
	int t;
	cin>>t;
	while(t--){
		double n,ans;
		scanf("%lf",&n);
		ans=1.0/tan(PI/(2.0*n));//这里要是弧度值
		printf("%.7lf\n",ans);
	}
	return 0;
}

你可能感兴趣的:(Codeforces,几何数学)