Advertisement
Guest User

Untitled

a guest
Dec 11th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <iomanip>
  4. #include <cstdlib>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. long double x,y;
  11. cin >>x;
  12. if (x<1)
  13. {
  14. y=2*x;
  15. cout << y;
  16. }
  17. else if (x==1)
  18. {
  19. y=-10;
  20. cout << y;
  21. }
  22. else if (x==3)
  23. {
  24. y=pow((x-1),4);
  25. cout << y;
  26. }
  27. else if (x==6)
  28. {
  29. y=sqrt(x-4);
  30. cout << y;
  31. }
  32. else
  33. {
  34. y=0;
  35. cout << y;
  36. }
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement