#include <iostream>
#include <cmath>
const double pi = 3.1415926;
using namespace std;
int main()
{
int T;
cin >> T;
double Lu[3][3];
while (T--)
{
cout << fixed;
cout.precision(2);
for (int i = 1; i <= 2; i++)
cin >> Lu[i][1] >> Lu[i][2];
if (Lu[1][1] * Lu[2][2] == Lu[1][2] * Lu[2][1])
{
cout << 0.00 << endl;
continue;
}
double x, y, q,p;
q = sqrt(Lu[1][1] * Lu[1][1] + Lu[1][2] * Lu[1][2]);
p = sqrt(Lu[2][1] * Lu[2][1] + Lu[2][2] * Lu[2][2]);
x = sqrt((Lu[1][1] - Lu[2][1]) * (Lu[1][1] - Lu[2][1]) + (Lu[1][2] - Lu[2][2]) * (Lu[1][2] - Lu[2][2]));
y = (q * q + p * p - x * x)/2.0/q/p;
y = acos(y) * 180/pi;
cout << y << endl;
}
return 0;
}
HDU ACM 11 2080 夹角有多大II
最新推荐文章于 2019-01-07 22:40:48 发布