'commit'
This commit is contained in:
22
TangDou/XiTi/1075.cpp
Normal file
22
TangDou/XiTi/1075.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user