fork download
  1. #include<iostream>
  2. #include<cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main(int argc, char)
  7. {
  8. double x, a, y;
  9. cout << "Input a, x: ";
  10. cin >> x >> a;
  11.  
  12. if (x < -30.1)
  13. y = (38.4 + x * a) / (pow(cos(x), 2) + 1.1);
  14. else if (x < 2.1)
  15. y = log(fabs(x)) + 3.6;
  16. else
  17. y = sqrt(x) + a * x;
  18.  
  19. cout << y << endl;
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 5652KB
stdin
3 
4
stdout
Input a, x: 13.7321