#include <iostream>
#include <cmath>
using namespace std;
double f1(double x)
{
return cos(x * x * x - sqrt(3));
}
double f2(double x, double y)
return cbrt(x * y * y);
int main()
double m = -2, z;
for(double y=0.4; y <= 4.1; y +=3)
for(double x=0.15; x<=0.551; x +=0.4)
z = max(f1(x), f2(x, y));
if (z > m) m = z;
z = m;
cout << z;
return 0;
На выводе будет 1.85257
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
#include <cmath>
using namespace std;
double f1(double x)
{
return cos(x * x * x - sqrt(3));
}
double f2(double x, double y)
{
return cbrt(x * y * y);
}
int main()
{
double m = -2, z;
for(double y=0.4; y <= 4.1; y +=3)
for(double x=0.15; x<=0.551; x +=0.4)
{
z = max(f1(x), f2(x, y));
if (z > m) m = z;
}
z = m;
cout << z;
return 0;
}
На выводе будет 1.85257