#include<iostream>
#include<iomanip>
#define _USE_MATH_DEFINES
#include<cmath>
using namespace std;
int main()
{
double a, b, c, alfa, beta, gamma;
cout <<"a="; cin >> a;
cout <<"b="; cin >> b;
cout <<"c="; cin >> c;
if (a+b>c && a+c>b && b+c>a)
alfa = acos((b*b+c*c-a*a)/(2*b*c))*180/M_PI;
beta = acos((a*a+c*c-b*b)/(2*a*c))*180/M_PI;
gamma = acos((a*a+b*b-c*c)/(2*a*b))*180/M_PI;
cout <<"Angles in degrees:\n";
cout <<setprecision(3)<<fixed<< "alfa=" << alfa << " beta=" << beta << " gamma=" << gamma << endl;
}
else cout << "Triangle absent\n";
system("pause");
return 0;
{
if (tnum < tden)
{
temp = tnum;
tnum = tden;
tden = temp;
}
tnum = tnum - tden;
}
gcd = tden; //вычисляем наибольший общий делитель
numerator = numerator / gcd; //делим числитель и знаменатель на
НОД, получаем сокращенную дробь
denominator = denominator / gcd;
#include<iostream>
#include<iomanip>
#define _USE_MATH_DEFINES
#include<cmath>
using namespace std;
int main()
{
double a, b, c, alfa, beta, gamma;
cout <<"a="; cin >> a;
cout <<"b="; cin >> b;
cout <<"c="; cin >> c;
if (a+b>c && a+c>b && b+c>a)
{
alfa = acos((b*b+c*c-a*a)/(2*b*c))*180/M_PI;
beta = acos((a*a+c*c-b*b)/(2*a*c))*180/M_PI;
gamma = acos((a*a+b*b-c*c)/(2*a*b))*180/M_PI;
cout <<"Angles in degrees:\n";
cout <<setprecision(3)<<fixed<< "alfa=" << alfa << " beta=" << beta << " gamma=" << gamma << endl;
}
else cout << "Triangle absent\n";
system("pause");
return 0;
}