用map做的,很简单
code:
#include <map>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
map<string,string> dict;
map<string,string>::iterator it;
char tmp1[25],tmp2[25],word[25];
char sent[3030];
int main()
{
//freopen("output.txt","w",stdout);
scanf("%s",tmp1);
while(scanf("%s",tmp1))
{
if(!strcmp(tmp1,"END"))break;
scanf("%s",tmp2);
dict[tmp2]=tmp1;
}
scanf("%s",tmp1);ge......
阅读全文