rt。
#include<bits/stdc++.h>
using namespace std;
map<string,bool>gd;
int n,i,value=0,j,cnt=0;
string l="",str[1005];
char c;
int main()
{
cin>>n;
for(i=1;i<=n;i++)
{
cin>>l;
for(j=0;j<l.size();j++)
if(l[j]>='A'&&l[j]<='Z')l[j]=l[j]-'A'+'a';
gd[l]=1;
}
getchar();
while(scanf("%c",&c)!=EOF)
{
l="";
if(c>='a'&&c<='z')l+=c;
else if(c>='A'&&c<='Z')l+=(c-'A'+'a');
else
{
if(gd[l]==1)
{
value++;
cnt++;
str[cnt]=l;
}
gd[l]=0;
l="";
}
if(c=='.')
for(j=1;j<=cnt;j++)
{
gd[str[j]]=1;
str[j]="";
}
}
cout<<value<<endl;
return 0;
}
jojo孩子吧