Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
143119 C班詹皓杰 行编辑程序 C++ 运行出错 92 0 MS 248 KB 433 2024-04-12 22:46:30

Tests(13/14):


#include<iostream> #include<stack> #include<string> #include<algorithm> using namespace std; stack<char> s; string ans; int main(){ char c; while(cin>>c){ if(c == '@'){ while(!s.empty()){ s.pop(); } } else if(c == '#'){ s.pop(); } else{ s.push(c); } } while(!s.empty()){ ans.push_back(s.top()); s.pop(); } reverse(ans.begin(),ans.end()); cout<<ans; return 0; }


测评信息: