#include <iostream>
#include <cmath>
using namespace std;
int main() {
double ang, rad, seno, cosseno, tangente, cotangente, secante, cossecante;
cout << "Digite o ângulo em graus: ";
cin >> ang;
rad = ang * 3.14159 / 180.0;
seno = sin(rad);
cosseno = cos(rad);
tangente = tan(rad);
if (tangente != 0)
cotangente = 1.0 / tangente;
else
cotangente = NAN;
if (cosseno != 0)
secante = 1.0 / cosseno;
else
secante = NAN;
if (seno != 0)
cossecante = 1.0 / seno;
else
cossecante = NAN;
cout << "Seno: " << seno << endl;
cout << "Cosseno: " << cosseno << endl;
cout << "Tangente: " << tangente << endl;
if (isnan(cotangente))
cout << "Cotangente: Indefinido" << endl;
else
cout << "Cotangente: " << cotangente << endl;
if (isnan(secante))
cout << "Secante: Indefinido" << endl;
else
cout << "Secante: " << secante << endl;
if (isnan(cossecante))
cout << "Cossecante: Indefinido" << endl;
else
cout << "Cossecante: " << cossecante << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBkb3VibGUgYW5nLCByYWQsIHNlbm8sIGNvc3Nlbm8sIHRhbmdlbnRlLCBjb3RhbmdlbnRlLCBzZWNhbnRlLCBjb3NzZWNhbnRlOwoKICAgIGNvdXQgPDwgIkRpZ2l0ZSBvIMOibmd1bG8gZW0gZ3JhdXM6ICI7CiAgICBjaW4gPj4gYW5nOwoKICAgIHJhZCA9IGFuZyAqIDMuMTQxNTkgLyAxODAuMDsKCiAgICBzZW5vID0gc2luKHJhZCk7CiAgICBjb3NzZW5vID0gY29zKHJhZCk7CiAgICB0YW5nZW50ZSA9IHRhbihyYWQpOwoKICAgIGlmICh0YW5nZW50ZSAhPSAwKQogICAgICAgIGNvdGFuZ2VudGUgPSAxLjAgLyB0YW5nZW50ZTsKICAgIGVsc2UKICAgICAgICBjb3RhbmdlbnRlID0gTkFOOwoKICAgIGlmIChjb3NzZW5vICE9I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