hdu 1004 Let the Balloon Rise
来源:互联网 发布:ubuntu apt get 源 编辑:程序博客网 时间:2024/06/05 14:10
#include<stdio.h>#include<string.h>#define N 1000struct balloons{ char color[15]; int count;}ball[N];int main(){ int n,i,j,k,max,a; char ch[15]; while(scanf("%d",&n),n) { scanf("%s",&ball[1].color); ball[1].count=1; k=2; for(i=2;i<=n;i++) { scanf("%s",ch); for(j=1;j<k;j++) { if(strcmp(ch,ball[j].color)==0) {ball[j].count++;break;} } if(j>=k) { strcpy(ball[k].color,ch); ball[k].count=1; k++; } } max=ball[1].count;a=1; for(i=2;i<=n;i++) { if(ball[i].count>max) { max=ball[i].count;a=i;} } printf("%s\n",ball[a].color); } return 0;}
- HDU 1004 Let the Balloon Rise
- HDU 1004 Let the Balloon Rise
- hdu 1004 Let the Balloon Rise
- HDU 1004 Let the Balloon Rise
- HDU--1004 Let the Balloon Rise
- hdu 1004 Let the Balloon Rise
- hdu 1004 Let the Balloon Rise
- HDU 1004 Let the Balloon Rise
- hdu 1004 Let the Balloon Rise
- HDU 1004 Let the Balloon Rise
- HDU 1004 Let the Balloon Rise
- Hdu 1004 - Let the Balloon Rise
- HDU 1004 Let the Balloon Rise
- HDU 1004 Let the Balloon Rise
- HDU--1004--Let the Balloon Rise
- hdu 1004 Let the Balloon Rise
- hdu 1004 Let the Balloon Rise
- HDU 1004 Let the Balloon Rise STL
- 588
- 在各浏览器中自定义滚动条样式
- 平时小总结(2)
- 挂接命令(mount)
- Windows+Mysql+Nginx+PHP环境搭建(wmnp)
- hdu 1004 Let the Balloon Rise
- 常用字符串相关库函数总结(一)
- linux上ln命令详细说明
- netlink流程的讲解
- Java的IO操作(五) - PrintStream类、字符流、Reader和Writer、带缓冲的字符流BufferedReader和BufferedWriter .
- ubuntu12.04防火墙设置
- 从textarea中获取数据,按原样显示
- Android NDK的理解
- Linux 负载分析