Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
160805 鸡哥 18高度为k的树 C++ Compile Error 0 MS 0 KB 237 2026-09-26 14:27:17

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:8: error: expected initializer before '++' token
   int s++; 
        ^
Main.cc:15:8: error: 's' was not declared in this scope
  cout<