求助:使用C或C++,三角形计算
#include <iostream> #include <cmath> #include <numbers> int main( void ) { double a = sqrt(3); double b = 3; double c = sqrt(12); double A = acos( (b*b+c*c-a*a)/(2*b*c) ) * std::numbers::inv_pi * 180; double B = acos( (c*c+a*a-b*b)/(2*c*a) ) * std::numbers::inv_pi * 180; double C = acos( (a*a+b*b-c*c)/(2*a*b) ) * std::numbers::inv_pi * 180; std::cout << A << std::endl; std::cout << B << std::endl; std::cout << C << std::endl; }