Friday, April 3, 2015

467A - George and Accommodation (Codeforces)

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
#define pf printf
#define sf scanf

int main()
{
    int n, p, q, count;
    sf("%d", &n);
    count = 0;
    while(n--)
    {
        sf("%d%d", &p, &q);
        if((q-p)>=2)
            count++;
    }
    pf("%d\n", count);
    return 0;
}

No comments:

Post a Comment

Compare equality of two string in C

#include <stdio.h> #include<string.h> int main() {     char* country = "Bangladesh";     char* country2;     ...