Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
157267 王晏林 找错误 C++ Compile Error 0 MS 0 KB 298 2026-07-21 14:27:59

Tests(0/0):


Code:

# include<iostream> using namespace std; int main(){ int a[50001],n,sum=0,b=0; cin>>n; for(int i=0;i<n;i++) cin>>a[i]; for(int i=0;i<n-1;i++){ if(sum<a[i]) sum=a[i]; if(sum>a[i+1]) else b++; } cout<<b; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:11: error: expected primary-expression before 'else'
           else  b++;
           ^