Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- using namespace std;
- int main()
- {
- double x{}, result{};
- SetConsoleOutputCP(1251);
- while (true) {
- cout << "Введіть значення x: ";
- cin >> x;
- if (cin.fail()) {
- cin.clear();
- cin.ignore(32767, '\n');
- cout << "Число було введено неправильно. Спробуйте ще раз!" << endl;
- continue;
- }
- else {
- break;
- }
- }
- result = cos(pow(x, 2.4) + 1) - fabs(sin(2 * x) - 5.76);
- cout << "Значення виразу: " << result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement