Problem Description
Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges’ favorite time is guessing the most popular problem. When the contest is over, they will count the balloons of each color and find the result.
This year, they decide to leave this lovely job to you.
Input
Input contains multiple test cases. Each test case starts with a number N (0 < N <= 1000) – the total number of balloons distributed. The next N lines contain one color each. The color of a balloon is a string of up to 15 lower-case letters.
A test case with N = 0 terminates the input and this test case is not to be processed.
Output
For each case, print the color of balloon for the most popular problem on a single line. It is guaranteed that there is a unique solution for each test case.
Sample Input
5
green
red
blue
red
red
3
pink
orange
pink
0
Sample Output
red
pink
输入包含多个测试用例。每个测试用例以数字 N (0 < N <= 1000) 开头,接下来的 N 行包含一种颜色。气球的颜色是一串多达15个小写字母。
N = 0 的测试用例终止输入,并且不处理此测试用例。
对于每种情况,在一行上打印气球的颜色,以处理最流行的问题。保证每个测试用例都有一个独特的解决方案。
和统计成绩的方式差不多,找到出现次数最多的单词,开二维数组
从第一个位置开始,找后边与之一样的单词(用strcmp判断),统计重复次数(开一维数组)
#include<stdio.h