Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
62135 邓昊源 校门外的树 C++ Compile Error 0 MS 0 KB 379 2023-12-17 15:19:52

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:16:9: error: 'i' was not declared in this scope
     for(i=0;i<=n;i++){
         ^
Main.cc:21:13: error: expected '}' at end of input
     return 0;
             ^