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;
- void medie(float a, float b, float c)
- {
- float MG, MA;
- MG = sqrt(a*b*c);
- cout << "MG=" << MG << endl;
- MA = (2 * a*b*c) / (a + b + c);
- cout << "MA=" << MA << endl;
- }
- void medie(float a, float b, float c, float d)
- {
- float MG, MA;
- MG = sqrt(a*b*c*d);
- cout << "MG=" << MG << endl;
- MA = (2 * a*b*c*d) / (a + b + c + d);
- cout << "MA=" << MA << endl;
- }
- int main()
- {
- float a, b, c, d;
- cout << "a=" << endl;
- cin >> a;
- cout << "b=" << endl;
- cin >> b;
- cout << "c=" << endl;
- cin >> c;
- cout << "d=" << endl;
- cin >> d;
- medie(a, b, c);
- medie(a, b, c, d);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement