HDU - 4585 Shaolin
解题思路:用分割法将前缀用map存起来,然后输出即可
#include<iostream>
#include<map>
using namespace std;
map<string,int>x;
int main()
{
string s;char c;while(1){
c=getchar();if(c=='\n'){
c=getchar();s.clear();}if(c=='\n') break;s+=c;x[s]++;}char ch[11];while(scanf("%s",&ch)!=EOF)printf("%d\n",x[ch]);return 0;
}