Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- double max(double, double, double);
- int main()
- {
- using namespace std;
- cout << "Enter a, b, c: " << endl;
- double a, b, c;
- cin >> a >> b >> c;
- cout << "Your result: " << max((a * a + b) / (2 * a * b * b), (b * b - a * c) / (c + 2 * b), (c * a) / (a + sqrt(b))) + max((a - pow(b, 1.0 / c)) / b, (pow(a, b) - pow(b, c)) / (pow(pow(a, a) + c, 0.25)), 1.0 / a) << endl;
- return 0;
- }
- double max(double x, double y, double z)
- {
- double max1, max2;
- if (x > y)
- {
- max1 = x;
- }
- else
- {
- max1 = y;
- }
- if (max1 > z)
- {
- max2 = max1;
- }
- else
- {
- max2 = z;
- }
- return max2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement