题目描述
按操作序列模拟一个文本编辑器:type c 在末尾输入字符 并清空重做记录;undo 撤销最近一次输入;redo 恢复最近一次被撤销的输入。输出最终文本。
输入格式
第一行一个整数 ;接下来 行,每行一条 type c、undo 或 redo。
输出格式
一行最终文本(可能为空行)。
样例
输入
7 type a type b undo type c undo redo redo
输出
ac
j00418.in输出j00418.out按操作序列模拟一个文本编辑器:type c 在末尾输入字符 并清空重做记录;undo 撤销最近一次输入;redo 恢复最近一次被撤销的输入。输出最终文本。
第一行一个整数 ;接下来 行,每行一条 type c、undo 或 redo。
一行最终文本(可能为空行)。
7 type a type b undo type c undo redo redo
ac