题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1075
map简单应用
代码:
1 #include <stdio.h> 2 #include <string.h> 3 #include <math.h> 4 #include <algorithm> 5 #include <iostream> 6 #include <ctype.h> 7 #include <iomanip> 8 #include <queue> 9 #include <map> 10 #include <stdlib.h> 11 using namespace std; 12 13 int main() 14 { 15 char b[12],s1[12],s2[12],ch; 16 map<string,string> mp; 17 int d=0; 18 gets(b); 19 while(scanf("%s%s",s1,s2),strcmp(s1,"END")){ 20 mp[s2]=s1; 21 } 22 getchar(); 23 while(scanf("%c",&ch)){ 24 if(isalpha(ch)) 25 b[d++]=ch; 26 else{ 27 b[d]='