Răspuns:
#include <iostream>
#include <cmath>
using namespace std;
float MG(float a, float b, float c) {
float exp=1.0/3, p=a*b*c;
return pow(p,exp);
}
float MA(float a, float b, float c, float d) {
float s=1.0/a+1.0/b+1.0/c+1.0/d, m=4.0/s;
return m;
}
int main()
{
float a,b,c,d;
cin >> a >> b >> c;
cout << MG(a,b,c) << endl;
cin >> d;
cout << MA(a,b,c,d);
return 0;
}
Explicație: