сперва вводишь значения x, y они подставляются в формулу z так: #include <iostream> #include <cmath> int main() { double x, y; std::cout « "Введите значение x: "; std::cin » x; std::cout « "Введите значение y: "; std::cin » y; double numerator = std::sin(x) + std::cos(y); double denominator = std::cos(x) - std::sin(y); double tgxy = std::tan(x * y); double Z = (numerator / denominator) * tgxy; std::cout « "Значение выражения Z = " « Z « std::endl; return 0; } Код #include <iostream> #include <cmath> int main() { double x, y; std::cout « "Введите значение x: "; std::cin » x; std::cout « "Введите значение y: "; std::cin » y; double numerator = std::sin(x) + std::cos(y); double denominator = std::cos(x) - std::sin(y); double tgxy = std::tan(x * y); double Z = (numerator / denominator) * tgxy; std::cout « "Значение выражения Z = " « Z « std::endl; return 0; }
Overdox, std::sin, std::cos и std::tan избыточно, нет? Хотя по стандарту они в пространстве имён std Главное работает, компилятор если что скажет #include <iostream> #include <cmath> int main() { float z, x, y; std::cin >> x >> y; z = (sin(x) + cos(y)) / (cos(x) - sin(y)) * tan(x*y); std::cout << z; return 0; } C #include <iostream> #include <cmath> int main() { float z, x, y; std::cin >> x >> y; z = (sin(x) + cos(y)) / (cos(x) - sin(y)) * tan(x*y); std::cout << z; return 0; } Данный код работал в onlinegdb без нареканий
Говоришь преподу, что ты Питонист и экономишь 6 строчек. from math import sin, cos, tan x = float(input('Введи 1-ое число: ')) y = float(input('Введи 2-ое число: ')) z = (sin(x) + cos(y)) / (cos(x) - sin(y)) * tan(x*y) print(z) Python from math import sin, cos, tan x = float(input('Введи 1-ое число: ')) y = float(input('Введи 2-ое число: ')) z = (sin(x) + cos(y)) / (cos(x) - sin(y)) * tan(x*y) print(z) Или все 8: from math import sin, cos, tan x, y = float(input('Введи 1-ое число: ')), float(input('Введи 2-ое число: ')) print((sin(x) + cos(y)) / (cos(x) - sin(y)) * tan(x*y)) Python from math import sin, cos, tan x, y = float(input('Введи 1-ое число: ')), float(input('Введи 2-ое число: ')) print((sin(x) + cos(y)) / (cos(x) - sin(y)) * tan(x*y))