Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- double Razv(double x,double y, double c, double d, int& vetka){
- double z;
- if(x * y > 3.0){
- z=x*x*x;
- double temp = pow(log(x*y),c*d);
- if(temp>z) z = temp;
- vetka = 1;
- }
- if(x*y >= 0.0 && x*y <= 3.0){
- z=x;
- double temp = y;
- double temp1;
- double tempmax1 = c*x;
- double tempmax2 = d*y;
- if(tempmax1 > tempmax2) temp1 = tempmax1;
- else temp1 = tempmax2;
- if(temp < z) z = temp;
- if(temp1 < z) z = temp1;
- z*=3;
- vetka = 2;
- }
- if(x<0.0){
- z = pow(2,c*d) - x;
- vetka = 3;
- }
- return z;
- }
- int main(){
- double x,y,c,d,z;
- int vetka = 0;
- cin >> x >> y >> c >> d;
- z = Razv(x,y,c,d, vetka);
- cout << "Ответ:" << z << endl << "Ветка:" << vetka;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement