Advertisement
kirya_shkolnik

Макс - 2

Jan 18th, 2021
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6. double Razv(double x){
  7.     double p;
  8.     if(x<0){
  9.         p = log10(pow(x,2));
  10.         double temp = exp(-2*x);
  11.         double temp1 = sin(2*x);
  12.         double temp2 = abs(x);
  13.         if(temp < p) p = temp;
  14.         if(temp1 < p) p = temp1;
  15.         if(temp2 < p) p = temp2;
  16.     }
  17.     if(x>=0 && x <1.5){
  18.         p = pow(cos(x),3);
  19.         double temp = sqrt(5*x);
  20.         double temp1 = pow(x,2);
  21.         if(temp > p ) p =temp;
  22.         if(temp1 > p ) p =temp1;
  23.        
  24.     }
  25.     if(x>=1.5){
  26.         p = sin(x-1);
  27.     }
  28.     return p;
  29. }
  30. int main()
  31. {
  32.     double x;
  33.     cin >> x;
  34.     cout << Razv(x);
  35.     return 0;
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement