You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
425 B
23 lines
425 B
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
int main() {
|
|
int N;
|
|
cin >> N;
|
|
int a[101] = {0};
|
|
for (int i = 0; i < N; ++i) {
|
|
cin >> a[i];
|
|
}
|
|
int max = INT32_MIN;
|
|
for (int i = 0; i < N; ++i) {
|
|
if (a[i] > max)max = a[i];
|
|
}
|
|
int sum = 0;
|
|
for (int i = 0; i < N; ++i) {
|
|
if (a[i] < max)sum += a[i];
|
|
}
|
|
cout << sum << endl;
|
|
return 0;
|
|
}
|