Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Вариант 8
- #include "pch.h" //для версий вижлы старше последних версий 2017 здесь должно быть #include "stdafx.h"
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- double x, y, f;
- int code;
- cout << "Chose f(x): 0 - sh(x), 1 - x^2, 2 - exp(x)" << endl;
- cin >> code;
- cout << "Enter x, y:" << endl;
- cin >> x >> y;
- switch (code)
- {
- case 0:
- f = sinh(x);
- break;
- case 1:
- f = x * x;
- break;
- case 2:
- f = exp(x);
- break;
- default:
- cout << "Неверный ввод!";
- return 0;
- }
- if (x / y < 0)
- {
- cout << pow(f * f + y, 3);
- }
- else if (x / y > 0)
- {
- cout << log(fabs(f / y)) + x / y;
- }
- else
- {
- cout << pow(fabs(sin(y)), 1 / 3.);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement