Advertisement
Guest User

Bai 3

a guest
Feb 27th, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. double f(double x)
  6. {
  7.     if (x > 0) return 3 * x +  sqrt(x);
  8.     else return exp(x) + 4;
  9. }
  10. int main()
  11. {
  12.     double x;
  13.     cin >> x;
  14.     cout << f(x) << '\n';
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement