Beginners contest: Loops - 2
Two players started a darts tournament. The tournament is a series of n games. In each game, participants perform a number of shots, gaining points. The game is considered won by the player who scored more points in it than the opponent. If the players scored an equal number of points in the game, then its outcome is considered to be a draw. The winner of the tournament is the one who get the most wins.
Write a program that determines the winner of the tournament.
First line contains the number of games n (1 ≤ n ≤ 1000) in the tournament. Each of the next n lines contains two integers - the number of points gained by the first and second player. All numbers are nonnegative integers no more than 1000.
Print number 1 if the winner is the first player, 2 if the winner is the second player, and 0 in the case of a tie.
3 3 1 1 0 1 2
2 1 1 0 5