Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
43720 | teacher_lu | 不与最大数相同的数字之和 | C++ | Accepted | 0 MS | 252 KB | 338 | 2024-03-19 19:26:24 |
#include <bits/stdc++.h> using namespace std; int main(){ int n,s=0; cin >> n; int a[n+1]; for(int i = 1; i <= n; i++) { cin >> a[i]; } int ma = a[1]; for(int i = 1; i <= n; i++) { if(a[i] >= ma) { ma = a[i]; } } for(int i = 1; i <= n; i++) { if(ma != a[i]) s+= a[i]; } cout << s; return 0; }