Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
95966 | 王思颜 | 找错误 | C++ | Compile Error | 0 MS | 0 KB | 288 | 2024-11-02 16:14:36 |
#include<bits/stdc++.h> using namespace std; int a[50001]; int main(){ int n,x = 0,y = 0; cin>>n; for (int i = 0;i <= n - 1;i++){ cin>>a[i]; } for (int j = 0;j <= n - 1;j++){ if (a[i] > x){ x = a[i]; } else{ y += 1; } } cout<<y; return 0; }
Main.cc: In function 'int main()': Main.cc:12:9: error: 'i' was not declared in this scope if (a[i] > x){ ^