Beispiel #1
0
int main()

{
	char present[11000],
		 word[1000];
	int count = 0;

	//freopen("a.in","r",stdin);
	
	while(cin.getline(word, 1000) && word[0] != ':')
		strcpy(iDic[count++], word);

	while(cin.getline(present, 1000))
		seperateFunction(present, count);

	for(pos = smap.begin() ; pos != smap.end() ; pos++)
		cout<<pos->second<<endl;
	return 0;
}
Beispiel #2
0
//_________________________________________________________________
void seperateFunction(char *str, int& count)
{
	int ite = 0, cnt;
	char word[15];//, help[15];

	while(1)
	{
		memset(word, 0, 15);
		for(cnt = 0 ; str[ite] != ' ' && str[ite] ; cnt++, ite++)
			word[cnt] = str[ite];

		//strcpy(help, word);
		if(!isIgnore(strlwr(word), count))
			smap.insert(make_pair(word, wordToUpper(strlwr(str), ite - cnt, ite)));
		if(!str[ite])	break;
		else	ite++;
	}
}
stringMap merge(stringMap a, stringMap b)
{
	stringMap tmp(a);
	tmp.insert(b.begin(), b.end());
	return tmp;
}