提交时间:2024-04-06 16:34:17

运行 ID: 142096

# 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 ; }