Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
70150 刘焕群 18高度为k的树 C++ Compile Error 0 MS 0 KB 274 2024-04-13 17:26:57

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; const int max=1e6+5; int a[maxn]; int main() { int n,k,s=0; cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; cin>>k; for(int i=1;i<=n;i++) { if(a[i]==k) s++; } cout<<s<<endl; return 0; }


Run Info:

Main.cc:4:7: error: 'maxn' was not declared in this scope
 int a[maxn];
       ^
Main.cc: In function 'int main()':
Main.cc:8:32: error: 'a' was not declared in this scope
     for(int i=1;i<=n;i++) cin>>a[i]; 
                                ^
Main.cc:10:32: error: 'a' was not declared in this scope
     for(int i=1;i<=n;i++) { if(a[i]==k) s++; } 
                                ^