Advertisement
Soverein

Untitled

Jan 29th, 2021
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include<iostream>
  2. #include<stdlib.h>
  3. #include<math.h>
  4. using namespace std;
  5. int main()
  6. {
  7. const double E = 0.001;
  8. double x=1, y=1, a=1, b=2, z,hx=0.1,hy=0.2 ;
  9. for (double x = 1; x < 2 + E; x += hx)
  10. for (double y = 1; y < 2 + E; y += hy)
  11. if (x + y <= 1)
  12. {
  13. z = pow(a, x) + pow(b, y);
  14. cout <<"\tx= "<<x<<"\ty="<<y<<"\tz= "<<z<< endl;
  15. }
  16. else if (x + y > 1)
  17. {
  18. z = a * pow(x, 2) + log(x * b * y);
  19. cout << "\tx= " << x << "\ty=" << y << "\tz=" << z << endl;
  20. }
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement