ACMer  
日历
<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011
统计
  • 随笔 - 3
  • 文章 - 9
  • 评论 - 3
  • 引用 - 0

导航

常用链接

留言簿(1)

随笔档案

文章分类

文章档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜

 
#include<stdio.h>
#include
<string.h>
#include
<stdlib.h>
int main(void)
{
    
char col[1001][16];char k[16];
    
int i=0;
    
int num,m,j=0,hnum=0,lnum;
    
while(scanf("%d",&num)!=EOF)
    {
        hnum
=0;i=0;
        
if(num==0)return 0;
        
while(i<num)
        {
            scanf(
"%s",col[i]);
            i
++;
        }
        strcpy(k,col[
0]);
        
for(j=0;j<num-1;j++
        {
            lnum
=0;
            
for(m=j+1;m<num;m++)
            {
             
if(strcmp(col[j],col[m])==0)
                 lnum
++;
            }
             
if(hnum<lnum)
             {
                 hnum
=lnum;
                 strcpy(k,col[j]);
             }    
        }
        printf(
"%s\n",k);
    }
    
return 0;
}

posted on 2009-02-22 17:51 小奇 阅读(391) 评论(0)  编辑 收藏 引用 所属分类: hdu

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


 
Copyright © 小奇 Powered by: 博客园 模板提供:沪江博客