fork download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. double y;
  7. int a, b, x, e;
  8. cin>>a>>b>>x>>y>>e;
  9.  
  10. if (x<=a)
  11. {
  12. y=pow(e, a*x)-3.8*cos(pow(a+b*x, 2));
  13. cout<<"x<=a; Res y="<<y;
  14.  
  15. }
  16.  
  17. else if (a<x<b)
  18. {
  19. y=a+log(pow(fabs(b+x), 2));
  20. cout<<"a<x<b; Res y="<<y;
  21. }
  22.  
  23. else if (x>=b)
  24. {
  25. y=pow(e, a*x)+b;
  26. cout<<"x>=b; Res y="<<y;
  27. }
  28.  
  29. return 0;
  30. }
  31.  
Success #stdin #stdout 0s 4480KB
stdin
1 2 3 4 5
stdout
a<x<b; Res y=4.21888