69,379
社区成员
发帖
与我相关
我的任务
分享
#include<stdio.h>
#include<string.h>
main()
{
int n,t,k,j,s=0;
char a[100][8];
scanf("%d",&n);
for(t=0;t<n;t++)
{
gets(a[t]);
}
for(k=0;k<n;k++)
{
for(j=k+1;j<n;j++)
{if(strcmp(a[k],a[j]==0)) s++;}
}
printf("%d\n",s);
}