LightOJ 1072 Calm Down

来源:互联网 发布:肇庆市房地产数据 编辑:程序博客网 时间:2024/05/01 23:22

题目链接 http://lightoj.com/volume_showproblem.php?problem=1072

没什么技术含量,搞清楚边角关系即可

#include <stdio.h>#include <math.h>#define PI acos(-1.0)int main (){int T,n;double R,r,alpha;scanf("%d",&T);for (int cas=1;cas<=T;cas++){scanf("%lf%d",&R,&n);alpha=PI/n;r=R/(1.0/sin(alpha)+1.0);printf("Case %d: %.8lf\n",cas,r);}return 0;}