Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #define _USE_MATH_DEFINES
- #include <math.h>
- using namespace std;
- int main() {
- double x, a;
- cout << "Enter \"x\" value\n";
- cin >> x;
- while (getchar() != '\n')
- ;
- cout << "Enter \"a\" value or press \"Enter\" to make it 1\n";
- char c;
- c = cin.peek();
- if (c == '\n')
- a = 1;
- else
- cin >> a;
- double M;
- if (x == 0 || (x < -3) || (log(a + x) + pow(M_E, a) == 0))){
- cout << "undefined";
- return 0;
- }
- M = (2 * x * x + sqrt(x + 3)) / ((log(a + x) + pow(M_E, a)) * atan(x));
- cout << M;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement