Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
151881 何兴驰 18第一次出现与最后一次出现的位置 C++ Compile Error 0 MS 0 KB 267 2026-04-19 11:44:34

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:16: error: expected primary-expression before '}' token
     if(a[i]==m)}
                ^
Main.cc: At global scope:
Main.cc:15:4: error: expected declaration before '}' token
    }
    ^