URI 1397 Game of The Greatest

/*
    @Author: Pranta Sarker
*/

// Nice Codeing Experience in linux(ubuntu 17.10) platform

#include<bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    int N;
    int cntA = 0, cntB = 0;

    while(cin >> N && N)
    {
        cntA = 0;
        cntB = 0;

        while(N--)
        {
            int A , B;
            cin >> A >> B;

            if(A > B) cntA += 1;
            else if(A < B) cntB += 1;
        }

        cout << cntA << " " << cntB << "\n";
    }

    return 0;
}

Comments

Popular posts from this blog

SPOJ-CMG - Collecting Mango

LightOJ 1009 - Back to Underworld

LeetCode Palindrome Number