解题思路:
注意事项:
参考代码:
def line_editor(input_str):
stack = []
output = ''
for char in input_str:
if char != '#' and char != '@':
stack.append(char)
elif char == '#':
if stack:
stack.pop()
elif char == '@':
stack = []
output = ''.join(stack)
return output
while True:
try:
input_str = input()
output_str = line_editor(input_str)
print(output_str)
except EOFError:
break
0.0分
0 人评分