Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
124301 徐浩天 22不与最大数相同的数字之和 C++ Compile Error 0 MS 0 KB 279 2025-07-11 11:22:07

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:15:2: error: expected ';' before 'cout'
  cout<