#include <iostream>
#include <map>
#include <cstring>
#include <string>
using namespace std;
int main()
{
int i, len;
char str[1000000];
map<string, int> m;
while( gets_s(str) )
{
len = strlen(str);
if ( !len )
{
break;
}
for(i = len; i > 0; i--)
{
str[i] = '\0';
m[str]++;//把单词从前面分成小的字符,如果相同,int ++;
}
}
while( gets_s(str) )
{
cout << m[str] << endl;//map里面比较
}
return 0;
}
杭电1251(map)
最新推荐文章于 2019-04-20 21:14:52 发布