Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- double itog(int a, int b, int c, int d, int e)
- {
- int ma, mi;
- if (a > b) ma = a;
- else ma = b;
- if (c > ma) ma = c;
- if (d > ma) ma = d;
- if (e > ma) ma = e;
- cout << "max=" << ma << endl;
- if (a < b) mi = a;
- else mi = b;
- if (c < mi) mi = c;
- if (d < mi) mi = d;
- if (e < mi) mi = e;
- cout << "min=" << mi << endl;
- return (a + b + c + d + e - ma - mi) / 3;
- }
- int main()
- {
- int a, b, c, d, e;
- cin >> a >> b >> c >> d >> e;
- printf("itog = %.2f", itog(a, b, c, d, e));
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement