九度OJ 1058:反序输出

题目地址:http://ac.jobdu.com/problem.php?id=1057

题目描述:

输入20个数,每个数都在1-10之间,求1-10中的众数(众数就是出现次数最多的数,如果存在一样多次数的众数,则输出权值较小的那一个)。

输入:

测试数据有多组,每组输入20个1-10之间的数。

输出:

对于每组输入,请输出1-10中的众数。

样例输入: 5 1 5 10 3 5 3 4 8 6 8 3 6 5 10 7 10 2 6 2
样例输出: 5

 

 1 #include<stdio.h>
 2 #include<string.h>
 3 
 4 int main()
 5 {
 6     char s[5];
 7     int i;
 8     while(gets(s)){
 9         i=3;
10         while(i>=0)   printf("%c",s[i--]);
11         printf("\n");
12     }
13 }
posted @ 2012-05-01 23:17  Bay  阅读(182)  评论(0)    收藏  举报