hdu2072(不同单词数)
#include<stdio.h>
#include<string.h>
char str[100000][50],ch[100000];
int main()
{
int word;
while(gets(ch))
{
if(strcmp(ch,"#")==0)
break;
word=0;
int i,j=0,j1=0,flog=1;
for(i=0;i<=strlen(ch);i++)
if(ch[i]!=' '&&ch[i]!='\0')
str[j][j1++]=ch[i];
else
{
str[j][j1]='\0';
j++;j1=0;
}
for(i=0;i<j;i++)
{
if(str[i][0]!='\0')
{
word++;
for(j1=i+1;j1<j;j1++)
if(strcmp(str[i],str[j1])==0)
str[j1][0]='\0';
}
}
printf("%d\n",word);
}
return 0;
}