ABC043B求助!!
  • 板块灌水区
  • 楼主Ying_Sophia
  • 当前回复4
  • 已保存回复4
  • 发布时间2023/10/8 19:56
  • 上次更新2023/11/2 14:53:51
查看原帖
ABC043B求助!!
768436
Ying_Sophia楼主2023/10/8 19:56

蒟蒻求助各位大佬!

啊啊啊为什么UnknownErrorUnknown Error……最讨厌这种未知错误了

ヽ(*。>Д<)o゜

题目传送门

#include<bits/stdc++.h>
using namespace std;
string a;
stack <char> s;

int main(){
    cin>>a;
    for(int i=0;i<a.size();i++){
    	if(a[i]=='0') s.push(a[i]);
    	else if(a[i]=='1') s.push(a[i]);
    	else if(a[i]=='B'){
    		if(!s.empty()) s.pop();
    		else continue;
		}
	}
	while(!s.empty()){
		cout<<s.top();
		s.pop();
	}
    return 0;
}

急求!!!感谢!!!

2023/10/8 19:56
加载中...