80分求助
查看原帖
80分求助
1251352
Wangzirui2012楼主2024/1/29 13:59
#include<bits/stdc++.h> 
using namespace std;
int x[100010]; 
int main() 
{ 
    int n , s = 0, max = -2e9; 
    cin >> n; 
    for (int i = 1; i <= n; i++) 
    { 
        cin >> x[i]; 
        s = s + x[i]; 
        if(x[i] > max) 
        { 
            max = x[i];
            }
    }
    cout << s - max;
    return 0;
}

2024/1/29 13:59
加载中...