1. 程式人生 > >計蒜客之蒜頭君學英語

計蒜客之蒜頭君學英語

#include<iostream>
#include<cstdio>
#include<stdlib.h>
#include<cstring>
#include<set>
using namespace std;
string word;
void tolow()
{
    for(int i=0;i<word.length();i++)
    {
        if(word[i]>='A'&&word[i]<='Z')word[i]=word[i]+32;
    }

}
int main()
{
	set<string> a;
	int n;
	cin>>n;
	
	while(n--)
	{
		int d;

		cin>>d>>word;
		tolow();
		if(d==0)
		a.insert(word);
		if(d==1)
		{
			if(a.count(word))
			cout<<"Yes";
			else
			cout<<"No";
			cout<<endl;
		}
	}
	return 0;
}