Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Laba2.6_II.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <math.h>
- #include <clocale>
- using namespace std;
- int main()
- {
- setlocale(0, "rus");
- double x,y,f;
- cout<<"Введите x и y через пробел:\n";
- cin>>x>>y;
- cout<<"Выберите f(x) (1 - sh(x), 2 - x^2, 3 - e^x):\n";
- int k;
- cin>>k;
- switch(k)
- {
- case 1:
- f=sinh(x);
- break;
- case 2:
- f=pow(x,2);
- break;
- case 3:
- f=exp(x);
- break;
- }
- double b;
- if(x/y>0)
- {
- b=log(f)+pow(abs(f),1.0/3);
- }
- else
- if(x/y<0)
- {
- b=log(abs(f/y))*pow(x+y,3);
- }
- else
- b=pow(pow(f,2)+y,3);
- cout<<endl<<"b="<<b<<endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment