Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
118422 | 梁乃元 | 行编辑程序 | C++ | 运行出错 | 92 | 0 MS | 252 KB | 541 | 2023-12-30 11:09:48 |
# include <bits/stdc++.h> using namespace std ; stack <char> lne ; int main ( ) { string s ; cin >> s ; for ( int i = 0 ; i < s . size ( ) ; 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 ; }