Advertisement
evage

fourth

Sep 18th, 2021
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #define _USE_MATH_DEFINES
  3. #include <math.h>
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8. double x, a;
  9. cout << "Enter \"x\" value\n";
  10. cin >> x;
  11. while (getchar() != '\n')
  12. ;
  13. cout << "Enter \"a\" value or press \"Enter\" to make it 1\n";
  14. char c;
  15. c = cin.peek();
  16. if (c == '\n')
  17. a = 1;
  18. else
  19. cin >> a;
  20. double M;
  21. if (x == 0 || (x < -3) || (log(a + x) + pow(M_E, a) == 0))){
  22. cout << "undefined";
  23. return 0;
  24. }
  25. M = (2 * x * x + sqrt(x + 3)) / ((log(a + x) + pow(M_E, a)) * atan(x));
  26. cout << M;
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement