Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<stdlib.h>
- #include<math.h>
- using namespace std;
- int main()
- {
- const double E = 0.001;
- double x=1, y=1, a=1, b=2, z,hx=0.1,hy=0.2 ;
- for (double x = 1; x < 2 + E; x += hx)
- for (double y = 1; y < 2 + E; y += hy)
- if (x + y <= 1)
- {
- z = pow(a, x) + pow(b, y);
- cout <<"\tx= "<<x<<"\ty="<<y<<"\tz= "<<z<< endl;
- }
- else if (x + y > 1)
- {
- z = a * pow(x, 2) + log(x * b * y);
- cout << "\tx= " << x << "\ty=" << y << "\tz=" << z << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement