Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <iomanip>
- using namespace std;
- int main() {
- SetConsoleOutputCP(1251);
- string names[5] = { "Градуси", "Синус", "Косинус", "Тангенс", "Котангенс" };
- int angle = 0;
- const double pi = 3.14159;
- double rad{};
- cout << string(61, '-') << endl;
- for (int i = 0; i < 5; i++) {
- cout << "|" << setw(10) << right << names[i] << " ";
- }
- cout << "|" << endl;
- cout << string(61, '-') << endl;
- for (int l = 1; angle <= 180; l++) {
- cout << "|" << setw(10) << angle << " ";
- rad = angle * pi / 180;
- cout << "|" << setw(10) << fixed << setprecision(4) << sin(rad) << " ";
- cout << "|" << setw(10) << fixed << setprecision(4) << cos(rad) << " ";
- if (angle == 90) {
- cout << "|" << setw(10) << "ні" << " ";
- }
- else {
- cout << "|" << setw(10) << fixed << setprecision(4) << tan(rad) << " ";
- }
- if (angle == 0 || angle == 180) {
- cout << "|" << setw(10) << "ні" << " ";
- }
- else {
- cout << "|" << setw(10) << fixed << setprecision(4) << 1 / tan(rad) << " ";
- }
- cout << "|" << endl;
- cout << string(61, '-') << endl;
- angle += 10;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement