Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
147699 陈奕涵 22不与最大数相同的数字之和 C++ Compile Error 0 MS 0 KB 358 2026-02-07 11:20:25

Tests(0/0):


Code:

#include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int main(){ int n,sum=0; int a[101]; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; sum+=a[i] } int max=a[1] for(int j=2;j<=n;j++){ if(a[j]>max)max=a[j]; } cout<<sum-max<<endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:13:5: error: expected ';' before '}' token
     }
     ^
Main.cc:15:5: error: expected ',' or ';' before 'for'
     for(int j=2;j<=n;j++){
     ^
Main.cc:15:17: error: 'j' was not declared in this scope
     for(int j=2;j<=n;j++){
                 ^