Sunday, May 29, 2016

CODEFORCES problem 467/A George and Accommodation

Problem link (Click here)

#include <iostream>
#include <cstdio>


using namespace std;

int main()
{
    int i, p, q, free, count=0;
    cin >> i;
    while(i--){
        cin >> p >> q;
        free = q-p;
        if(free>=2)
            count++;
    }
    cout << count << endl;

    return 0;
}

No comments:

Post a Comment