Let the Balloon Rise Wrong Answer
#include<stdio.h>#include<string.h>intmain(){inti,n,j,max,k;chara[1000][15];intcount[...
#include<stdio.h>
#include<string.h>
int main()
{
int i,n,j,max,k;
char a[1000][15];
int count[1000] = {0};
max = 0;
while(scanf("%d", &n) != EOF && n != 0)
{
i= 0;
scanf("%s",&a[i]);
for(i = 1; i < n; i++)
{
scanf("%s",&a[i]);
for(j = 0;j < i;j++)
{
if(strcmp(a[i],a[j]) == 0)
{
count[j]++;
}
}
}
for(i = 0;i < n ; i++)
{
if(a[i] > max)
{
max = count[i];
k = i;
}
}
printf("%s\n",a[k]);
}
return 0 ;
} 展开
#include<string.h>
int main()
{
int i,n,j,max,k;
char a[1000][15];
int count[1000] = {0};
max = 0;
while(scanf("%d", &n) != EOF && n != 0)
{
i= 0;
scanf("%s",&a[i]);
for(i = 1; i < n; i++)
{
scanf("%s",&a[i]);
for(j = 0;j < i;j++)
{
if(strcmp(a[i],a[j]) == 0)
{
count[j]++;
}
}
}
for(i = 0;i < n ; i++)
{
if(a[i] > max)
{
max = count[i];
k = i;
}
}
printf("%s\n",a[k]);
}
return 0 ;
} 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏10(财富值+成长值)
1个回答
展开全部
#include<stdio.h>
#include<string.h>
int main()
{
int i,n,j,max,k;
char a[1000][16];
int count[1000] = {0};
max = 0;
while(scanf("%d", &n) != EOF && n != 0)
{
i = 0;
scanf("%s", &a[i]);
count[i] = 0;
for(i = 1; i < n; i++)
{
scanf("%s",&a[i]);
count[i] = 0;
for(j = 0;j < i;j++)
{
if(strcmp(a[i],a[j]) == 0)
{
count[j]++;
}
}
}
max = -1;
for(i = 0; i < n; i++)
{
if(count[i] > max)
{
max = count[i];
k = i;
}
}
printf("%s\n",a[k]);
}
return 0 ;
}
#include<string.h>
int main()
{
int i,n,j,max,k;
char a[1000][16];
int count[1000] = {0};
max = 0;
while(scanf("%d", &n) != EOF && n != 0)
{
i = 0;
scanf("%s", &a[i]);
count[i] = 0;
for(i = 1; i < n; i++)
{
scanf("%s",&a[i]);
count[i] = 0;
for(j = 0;j < i;j++)
{
if(strcmp(a[i],a[j]) == 0)
{
count[j]++;
}
}
}
max = -1;
for(i = 0; i < n; i++)
{
if(count[i] > max)
{
max = count[i];
k = i;
}
}
printf("%s\n",a[k]);
}
return 0 ;
}
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询