http://acdreamoj.sinaapp.com/problem.php?id=1084
证明过程 链接正方形的对角线 然后证明两个三角形相等;
1 #include<iostream> 2 #include<stdio.h> 3 #include<cstring> 4 #include<algorithm> 5 #include<cmath> 6 using namespace std; 7 8 int main( ) 9 { 10 int T; 11 double N,a; 12 scanf("%d",&T); 13 while( T-- ) 14 { 15 scanf("%lf%lf",&N,&a); 16 if( a >= 90 ) a -= 90; 17 if( a == 0 ) 18 { 19 printf("%.2lf\n",N*N); 20 continue; 21 } 22 a = a*3.141592654/180.0; 23 double r = N/( 1 + cos(a) + sin(a) ); 24 printf("%.2lf\n",N*N-r*r*(sin(2*a))); 25 } 26 return 0; 27 }