fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. ios_base::sync_with_stdio(false); cin.tie(NULL);
  6. int N, p[105], q[105], cnt = 0;
  7. cin >> N;
  8. for(int i = 0; i < N; i++) {
  9. cin >> p[i] >> q[i];
  10. if((q[i] - p[i]) >= 2) {
  11. cnt++;
  12. }
  13. }
  14. cout << cnt;
  15. return 0;
  16. }
Success #stdin #stdout 0s 5444KB
stdin
3
1 10
0 10
10 10
stdout
2