fork download
  1. #include <iostream>
  2. // #include <math.h>
  3. #include <cmath>
  4.  
  5.  
  6. using namespace std;
  7.  
  8.  
  9. int main()
  10. {
  11. double x, y,f;
  12.  
  13. cout<<"x = "; cin>>x;
  14. cout<<"y = "; cin>>y;
  15. cout<<"\n("<<x<<"; "<<y<<")";
  16. if ((x > 0) && (y < 0))
  17. f = (- 1) + exp(-x + -y);
  18. else {
  19. if (x > 0 && y < 0)
  20. f = x + y;
  21. else f = pow (sin(x+y),2);
  22. }
  23.  
  24. cout<<"f= "<<f;
  25. cout<<endl;
  26.  
  27. // system("pause");
  28. // return 0;
  29. }
Success #stdin #stdout 0s 2988KB
stdin
2.56 -56.87
stdout
x = y = 
(2.56; -56.87)f= 3.85952e+23