HDOJ 1004 Let The Ball Rise
来源:互联网 发布:手机商城html源码 编辑:程序博客网 时间:2024/05/20 09:49
这道题多次不过,就是因为忘记在每次的n值输入之后,对计数的数组清零。。。。
#include"stdio.h" #include"string.h" main() { char s[1000][15],temp[15]; int i,j,n,change,max,m,k; int count[1000]; while((scanf("%d",&n))!=EOF&&n!=0) { memset(count,0,1000); getchar();//吸收输入n之后的回车符 m=0; for(i=0;i<n;i++) { change=1; gets(temp); for(j=0;j<m;j++) { if(strcmp(temp,s[j])==0) { change=0; count[j]++; } } if(change) { m++; strcpy(s[m-1],temp); count[m-1]++; } } for(i=0,max=0;i<m;i++) { if(count[i]>max) { max=count[i]; k=i; } } printf("%s\n",s[k]); } return 0; }
- HDOJ 1004 Let The Ball Rise
- HDOJ 1004 Let the Balloon Rise (map)
- HDOJ-1004 Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise
- hdoj 1004 Let the Balloon Rise
- hdoj.1004 Let the Balloon Rise 20140726
- HDOJ---1004(Let the Ballon Rise)
- HDOJ Let the Balloon Rise 1004
- HDOJ 1004 Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise(水题)
- 【HDOJ】【1004】Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise
- HDoj 1004 Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise
- hdoj 1004 Let the Balloon Rise (map)
- HTML <input> 标签
- memset函数
- HDOJ 1009 FatMouse' Trade简单的贪心
- HDOJ 1005 Number Sequence 斐波那契找循环
- JXGL数据库表截图
- HDOJ 1004 Let The Ball Rise
- 数据库误删
- cocos2d-x初探学习笔记(19)--物理引擎box2d(1)
- VS2010 lib和dll导出路径设置
- HDOJ 1003 Max Sum 动态规划入门(
- bbed还原数据实例
- 移植Mer-qtmediahub到hi3716m(1):mer-qtmediahub的rootfs制作
- HDOJ 1002 A+B problem Ⅱ大数相加
- IT职场人生系列之二十:危险职业(下)