样例输入:95 90 80 99 75
样例输出:265
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n, maxn, minn, i, sum;
- maxn = 0;
- minn = 101;
- sum = 0;
- for(i = 1; i <= 5; i++)
- {
- scanf("%d", &n);
- maxn = max(maxn, n);
- minn = min(minn, n);
- sum = sum + n;
- }
- sum = sum - maxn - minn;
- printf("%d\n", sum);
- return 0;
- }