CDZSC_2015寒假新人(1)——基础 a
Description
This year, they decide to leave this lovely job to you.
Input
A test case with N = 0 terminates the input and this test case is not to be processed.
Output
Sample Input
green
red
blue
red
red
3
pink
orange
pink
0
Sample Output
#include<cstring>
#include<cstdio>
using namespace std;
int main()
{
char a[][];
int b[],m;
int n;
while((scanf("%d",&n))&&n!=)
{
m=;
for(int i=;i<n;i++)
{
scanf("%s",a[i]);
b[i]=;
for(int j=;j<i;j++)
{
if(strcmp(a[i],a[j])==)
{
b[j]++;
if(b[m]<b[j])
{
m=j;
}
break;
}
}
}
for(int i=;i<n;i++)
{
if(b[i]==b[m])
{
printf("%s\n",a[i]);
}
}
}
}
CDZSC_2015寒假新人(1)——基础 a的更多相关文章
- CDZSC_2015寒假新人(1)——基础 i
Description “Point, point, life of student!” This is a ballad(歌谣)well known in colleges, and you mus ...
- CDZSC_2015寒假新人(1)——基础 h
Description Ignatius was born in a leap year, so he want to know when he could hold his birthday par ...
- CDZSC_2015寒假新人(1)——基础 g
Description Ignatius likes to write words in reverse way. Given a single line of text which is writt ...
- CDZSC_2015寒假新人(1)——基础 f
Description An inch worm is at the bottom of a well n inches deep. It has enough energy to climb u i ...
- CDZSC_2015寒假新人(1)——基础 e
Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever ...
- CDZSC_2015寒假新人(1)——基础 d
Description These days, I am thinking about a question, how can I get a problem as easy as A+B? It i ...
- CDZSC_2015寒假新人(1)——基础 c
Description FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the wareho ...
- CDZSC_2015寒假新人(1)——基础 b
Description The highest building in our city has only one elevator. A request list is made up with N ...
- CDZSC_2015寒假新人(2)——数学 P
P - P Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status ...
随机推荐
- (原+转)error C2872: “ACCESS_MASK”: 不明确的符号 C:\Program Files (x86)\Windows Kits\8.1\Include\um\ktmw32.h 125
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5500795.html 参考网址: http://www.lxway.com/88515256.htm ...
- (原)vs2013静态及动态链接opencv3.0的库
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5477551.html 静态链接步骤如下: 1. 在“通用配置”-“VC++目录”-“包含目录”中添加: ...
- (原)配置vs2013使用intel的IPP库
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5473890.html 参考网址: https://software.intel.com/en-us/n ...
- spring 上传图片
@RequestMapping(value = "/upload",method = RequestMethod.POST) public String upload(@Reque ...
- html5增强元素--续
progress元素使用例子 <script> ; function progress_demo() { ) { i++; updateProgress(i); setTimeout(pr ...
- jq插件处女座 图片轮播
好久没写博客了,变得好懒呀,无地自容.最近一直在学sass和jq插件的写法,照猫画虎的谢了一个jq的插件,也算是第一次真正称得上插件的插件 ,废话不多说 上代码 (function($) { $.fn ...
- WPF实现毛玻璃效果
1和2需要Microsoft.WindowsAPICodePack.Shell.dll 和引用using System.Windows.Interop,并只能在有DwmApi.dll 版本的Windo ...
- codecomb 2098【stone】
题目描述 Description n个石堆围成一圈,提供两种操作: 1.每次将[L,R]堆的石子数量+k,其中,1<=L,R<=n,k>=0. 2.询问有最多石子的那一堆有多少石子. ...
- bzoj1650 [Usaco2006 Dec]River Hopscotch 跳石子
Description Every year the cows hold an event featuring a peculiar version of hopscotch that involve ...
- Binary Tree Level Order Traversal 解答
Question Given a binary tree, return the level order traversal of its nodes' values. (ie, from left ...