Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "math.h"
- #include "iostream"
- #include "conio.h"
- using namespace std;
- int main()
- {
- double x,y,f,a;
- int k;
- cout << "Enter x="; cin >> x;
- cout << "Enter y="; cin >> y;
- cout << "Choose f: 1-sh(x), 2-x^2, 3-exp(x) f="; cin >> k;
- switch(k)
- {
- case 1: sinh(x); break;
- case 2: pow(x,2); break;
- case 3: exp(x); break;
- default: cout << "Function not chosen"; return 1;
- }
- if (x*y>0) a=(x+y)*(x+y)-pow(fabs(x),1/3);
- else if (x*y<0) a=(x+y)*(x+y)+sin(x);
- else a=(x+y)*(x+y)+pow(y,3);
- cout << "Result=" << a << endl;
- _getch();
- return 0;
- }
Add Comment
Please, Sign In to add comment