题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=5858
题意:求阴影部分面积
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
#define PI acos(-1.0)
int main()
{
int r,t;
scanf("%d",&t);
while(t--)
{
double r,s,ss,sss,k,s3;
scanf("%lf",&r);
double n=(acos(1.25/(sqrt(2.0))))*2.0;
ss=1.0*r*r*acos(1.25/(sqrt(2.0)))*2.0*0.5;
sss=0.5*r*r*sin(acos(1.25/(sqrt(2.0)))*2.0);
s=ss-sss;
k=2.0*PI-2.0*acos(-sqrt(2.0)/4.0);
s=0.25*r*r*k/2.0-s-0.25*r*r*sin(k)*0.5;
s*=2.0;
printf("%.2lf\n",s);
}
return 0;
}