Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
95442 罗子童 18高度为k的树 C++ Compile Error 0 MS 0 KB 544 2024-10-27 18:18:01

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int s=0; long long K,a[1000000]; for(int i=1;i<=n;i++){ cin>>a[i]; } cin>>k; for(int i=0;i<=101;i++){ if(a[i]>k) s=+1; } cout<<s return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:20: error: 'n' was not declared in this scope
     for(int i=1;i<=n;i++){
                    ^
Main.cc:13:10: error: 'k' was not declared in this scope
     cin>>k;
          ^
Main.cc:21:5: error: expected ';' before 'return'
     return 0;
     ^
Main.cc:9:15: warning: unused variable 'K' [-Wunused-variable]
     long long K,a[1000000];
               ^