Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
125163 唐诗阳 校门外的树 C++ Compile Error 0 MS 0 KB 467 2025-07-13 16:01:40

Tests(0/0):


Code:

#include<iostream> #include<cstdio> //scanf()\printf() #include<cstring> #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int l,m,a[10001]={0},j,y,s=0; cin>>l>>m; for(int i=1;i<=m;i++){ cin>>x>>y; for(int j=x;j<=y;j++){ a[j]=1; } } for(int i=0;i<=l;i++){ if(a[i]!=1){ s++; } } cout<<s; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:14: error: 'x' was not declared in this scope
         cin>>x>>y;
              ^
Main.cc:7:26: warning: unused variable 'j' [-Wunused-variable]
     int l,m,a[10001]={0},j,y,s=0;
                          ^