Добавил:
vvrstcnho
Рад, если кому-то помог
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Лабораторные работы С++ (для ИВТ) / Готовые лабы С++ / Лаба1 / Laba 1 (2)
.cpp#include <iostream>
#include <cmath>
#include <windows.h>
using namespace std;
const double PI = 3.14159265358979323846;
class Angle {
private:
double degrees;
public:
void input() {
cout << "Введите угол в градусах: ";
cin >> degrees;
}
void output() {
cout << "Угол: " << degrees << "°" << endl;
}
double toRadians() {
return degrees * PI / 180.0;
}
double sinAngle() {
return sin(toRadians());
}
};
int main() {
SetConsoleOutputCP(65001);
Angle a;
cout << "=== Работа с углом ===" << endl;
a.input();
a.output();
cout << "Угол в радианах: " << a.toRadians() << endl;
cout << "Синус угла: " << a.sinAngle() << endl;
return 0;
}
Соседние файлы в папке Лаба1
