Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
106501 何松羽 22砝码的重量 C++ Accepted 1 MS 272 KB 333 2025-01-16 12:04:33

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n]; for (int i = 0; i <= n - 1; i++) { cin >> a[i]; } int s = 0; for (int i = 0; i < n; i++) { s = s + a[i]; } int c = a[0]; for (int i = 1; i < n; i++) { if (a[i] < c) { c = a[i]; } } cout<<s-c; return 0; }