数学 ACdream 1196 KIDx's Triangle

时间:2023-10-19 20:38:44

题目传送门

 /*
这道题花了好长时间AC,思路有,但是表达式少写了括号一直乱码,囧!
注意:a==0时要特判:)
*/
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <string>
#include <cmath>
using namespace std; const int MAXN = 1e4 + ;
const int INF = 0x3f3f3f3f;
const double PI = acos (-1.0); double f(double k)
{
return 1.0 * k * PI / ;
} int main(void) //ACdream 1196 KIDx's Triangle
{
//freopen ("H.in", "r", stdin); double a, b, c, d;
double ae, cd, ce, de, ab, ad, be, bd;
double x;
while (scanf ("%lf%lf%lf%lf", &a, &b, &c, &d) == )
{
if (a == )
{
puts ("0.00"); continue;
} ad = sin (f(c)) / sin (f(a+b+c));
ae = sin (f(c+d)) / sin (f(b+c+d));
be = sin (f(b)) / sin (f(b+c+d));
bd = sin (f(a+b)) / sin (f(a+b+c));
de = sqrt (be*be + bd*bd - * be * bd * cos (f(d))); x = acos ((de*de+ae*ae-ad*ad) / (2.0 * de * ae)) * / PI; if (x < ) printf ("%.2f\n", 180.0 - x);
else printf ("%.2f\n", x);
} return ;
}