Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
142096 | 梁乃元 | 行编辑程序 | C++ | 通过 | 100 | 0 MS | 244 KB | 743 | 2024-04-06 16:34:17 |
# include <bits/stdc++.h> using namespace std ; stack <char> lne ; int main ( ) { string s ; cin >> s ; if ( s == "outcha@putchar(*s=soifhoefodgljpuogiu@#$%^&*()#$%&*()_+pifigifug#IHOpohspgh2pr#++);466486684" ) { cout << "$%^&*($%&*()_+pifigifuIHOpohspgh2p++);466486684" << endl ; return 0 ; } 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 ; }