【链接】h在这里写链接
【题意】
在这里写题意
【题解】
在这里写题解
【错的次数】
0
【反思】
在这了写反思
【代码】
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
int in[N + 10], out[N + 10], n;
int main() {
//freopen("F:\\rush.txt", "r", stdin);
ios::sync_with_stdio(0);
cin >> n;
int cnt = 0;
for (int i = 1; i <= n; i++) {
int l, r;
cin >> l >> r;
cnt += r - l + 1;
}
cout << cnt << endl;
return 0;
}