#include
using namespace std;
int main() {
const int n = 5;
int a[n];
int min, max, s;
for (int i = 0; i < n; i++) cin >> a[i];
min = a[0];
max = a[0];
s = a[0];
for (int i = 1; i < n; i++){
if (a[i] if (a[i]>max) max = a[i];
s = s+a[i];
}
cout << "min = " << min << " max = " << max << "\n"; <br> cout << "Средняя = " << double(s-min-max)/(n-2);<br>
return 0;
}
Пример:
5 6 4 7 8
min = 4 max = 8
Средняя = 6