c语言 ACM一题Problem DescriptionContest time again!How excited i
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/11 15:08:00
c语言 ACM一题
Problem Description
Contest time again!How excited it is to see balloons floating around.But to tell you a secret,the judges' favorite time is guessing the most popular problem.When the contest is over,they will count the balloons of each color and find the result.
This year,they decide to leave this lovely job to you.
Input
Input contains multiple test cases.Each test case starts with a number N (0 < N
Problem Description
Contest time again!How excited it is to see balloons floating around.But to tell you a secret,the judges' favorite time is guessing the most popular problem.When the contest is over,they will count the balloons of each color and find the result.
This year,they decide to leave this lovely job to you.
Input
Input contains multiple test cases.Each test case starts with a number N (0 < N
#include
#include
int main()
{
int num;
while(scanf("%d",&num) == 1 && num)
{
char a[1000][16] = {0},b[16];
int i,l,max = 0,size = 0,count[1000] = {0};
for(i = 0; i < num; i++)
{
scanf("%s",b);
int pd = 1;
for(l = 0; *a[l]; l++)
if(!strcmp(a[l],b)) { count[l]++; pd = 0; break; }
if(pd) { strcpy(a[size],b); count[size++]++; }
}
for( i = 0; *a[i]; i++)
count[i] > max max = count[i],size = i :0;
printf("%s\n",a[size]);
}
return 0;
}
#include
int main()
{
int num;
while(scanf("%d",&num) == 1 && num)
{
char a[1000][16] = {0},b[16];
int i,l,max = 0,size = 0,count[1000] = {0};
for(i = 0; i < num; i++)
{
scanf("%s",b);
int pd = 1;
for(l = 0; *a[l]; l++)
if(!strcmp(a[l],b)) { count[l]++; pd = 0; break; }
if(pd) { strcpy(a[size],b); count[size++]++; }
}
for( i = 0; *a[i]; i++)
count[i] > max max = count[i],size = i :0;
printf("%s\n",a[size]);
}
return 0;
}
c语言 ACM一题Problem DescriptionContest time again!How excited i
c语言acm题
一道acm题,Problem H:Groups (I)Time Limit:1000MS Memory Limit:65
ACM C语言 算法题
acm的题,C语言编程,
c语言 Money Problem
C语言 Search Problem
一sorry ,Ican not work out this problem.一Try again ,please .I
关于简单的C语言的ACM,
C语言:ACM大数运算问题.
ACM C语言算法 括号的深度
acm的一道c语言问题