#include<iostream>using namespace std;int main(){ int n; while(cin >> n && n != 0) { string from[16],to[16]; getline(cin,from[0]); for(int i = 0; i < n; ++i) { getline(cin,from[i]); getline(cin,to[i]); } string str; getline(cin,str); for(int i = 0; i < n; ++i) { int pos; while((pos = str.find(from[i])) != string::npos) str.replace(pos,from[i].size(),to[i]); } cout << str << endl; } return 0;}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)