Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
118427 | 梁乃元 | 行编辑程序 | C++ | 运行出错 | 92 | 0 MS | 248 KB | 561 | 2023-12-30 11:12:51 |
# include <bits/stdc++.h> using namespace std ; char s [114514] ; stack <char> lne ; int main ( ) { cin >> s ; int l = strlen ( s ) ; for ( int i = 0 ; i < l ; i ++ ) { if ( s [i] != '#' && s [i] != '@' ) { lne . push ( s [i] ) ; } if ( s [i] == '#' ) { lne . pop ( ) ; } if ( s [i] == '@' ) { while ( ! lne . empty ( ) ) { lne . pop ( ) ; } } } string ans = "" ; while ( ! lne . empty ( ) ) { ans = lne . top ( ) + ans ; lne . pop ( ) ; } cout << ans << endl ; return 0 ; }