Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - A c language topic
A c language topic
# include & ltstdio.h & gt

# include & ltstring.h & gt

Structure a

{

char str[ 100];

int coun;

};

int main()

{

Structure a unit [10000];

int i,j,n,flag,k;

char s[ 100];

//freopen ("let the balloon rise. in", "r", stdin);

//freopen(" Let the Balloon rise . out "," w ",stdout);

while(scanf("%d ",& ampn)! EOF & amp& ampn! =0)

{

j = 0;

uni[0]。 cou = 0;

while(n -)

{

scanf("%s ",s);

flag = 0;

for(I = 0; I<= j;; i++)

{

if(strcmp(uni[i].str,s)==0)

{

uni[i]。 cou++;

flag = 1;

Break;

}

}

If (flag ==0)

{

j++;

strcpy(uni[j].str,s);

uni[j]。 cou = 1;

}

}

k = 0;

for(I = 0; I<= j;; i++)

{

if(uni[i].cou & gtuni[k]。 cou)

k = I;

}

printf("%s\n ",uni[k]。 str);

}

Returns 0;

}