Advertisement
Guest User

Untitled

a guest
Oct 21st, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdlib.h>
  3. #include<math.h>
  4. using namespace std;
  5.  
  6. void medie(float a, float b, float c)
  7. {
  8.     float MG, MA;
  9.     MG = sqrt(a*b*c);
  10.     cout << "MG=" << MG << endl;
  11.     MA = (2 * a*b*c) / (a + b + c);
  12.     cout << "MA=" << MA << endl;
  13.  
  14. }
  15.  
  16. void medie(float a, float b, float c, float d)
  17. {
  18.     float MG, MA;
  19.     MG = sqrt(a*b*c*d);
  20.     cout << "MG=" << MG << endl;
  21.     MA = (2 * a*b*c*d) / (a + b + c + d);
  22.     cout << "MA=" << MA << endl;
  23. }
  24.  
  25. int main()
  26. {
  27.     float a, b, c, d;
  28.     cout << "a=" << endl;
  29.     cin >> a;
  30.     cout << "b=" << endl;
  31.     cin >> b;
  32.     cout << "c=" << endl;
  33.     cin >> c;
  34.     cout << "d=" << endl;
  35.     cin >> d;
  36.  
  37.     medie(a, b, c);
  38.  
  39.     medie(a, b, c, d);
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement