| 记录编号 | 
        275379 | 
        评测结果 | 
        AAAAAAAAAA | 
    
    
        | 题目名称 | 
        46.字符串编辑 | 
        最终得分 | 
        100 | 
            
    
    
        | 用户昵称 | 
         ミント | 
        是否通过 | 
        通过 | 
    
    
        | 代码语言 | 
        C++ | 
        运行时间 | 
        0.003 s  | 
    
    
        | 提交时间 | 
        2016-07-02 10:33:34 | 
        内存使用 | 
        0.31 MiB  | 
        
    
    
    
    		显示代码纯文本
		
		#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define is_cha(x) ((x <= 'z' and x >= 'a') or (x <= 'Z' and x >= 'A'))
#define is_sym(x) (x != '\n' and x != '\r')
#define is_ch(x) (is_cha(x) or is_sym(x))
inline string GetString(){
	char tmp = getchar();
	string ans;ans.clear();
	while(!is_ch(tmp))tmp = getchar();
	while( is_ch(tmp)){
		ans += tmp;tmp = getchar();
	}
	return ans;
}
int main(){
	freopen("edit.in", "r", stdin);
	freopen("edit.out", "w", stdout);
	
	string str = GetString();
	int lstr = str.length();
	char op, a1, a2;cin>>op;
	bool flag = false;
	if(op=='D'){
		cin>>a1;
		for(int i=0;i<lstr;i++)
			if(str[i]==a1){
				str = str.erase(i, 1);
				flag = true;break;
			}
	}
	else if(op=='I'){
		string a2;cin>>a1>>a2;
		for(int i=lstr-1;i>=0;i--)
			if(str[i]==a1){
				str = str.insert(i, a2);
				flag = true;break;
			}
	}
	else if(op=='R'){
		cin>>a1>>a2;
		for(int i=0;i<lstr;i++)
			if(str[i]==a1){
				str[i] = a2;
				flag = true;//break;
			}
	}
	else cout<<"Orz Cstdio"<<endl;
	cout<<(flag?str:"error")<<endl;
	return 0;
}