Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. double itog(int a, int b, int c, int d, int e)
  5. {
  6.     int ma, mi;
  7.     if (a > b) ma = a;
  8.     else ma = b;
  9.     if (c > ma) ma = c;
  10.     if (d > ma) ma = d;
  11.     if (e > ma) ma = e;
  12.  
  13.  
  14.     cout << "max=" << ma << endl;
  15.  
  16.     if (a < b) mi = a;
  17.     else mi = b;
  18.     if (c < mi) mi = c;
  19.     if (d < mi) mi = d;
  20.     if (e < mi) mi = e;
  21.     cout << "min=" << mi << endl;
  22.     return (a + b + c + d + e - ma - mi) / 3;
  23. }
  24. int main()
  25. {
  26.     int a, b, c, d, e;
  27.     cin >> a >> b >> c >> d >> e;
  28.     printf("itog = %.2f", itog(a, b, c, d, e));
  29.     cout << endl;
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement