kirya_shkolnik

C++ - Антон - 2

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