不是我寻思着这也没问题啊
查看原帖
不是我寻思着这也没问题啊
1419738
liyinzhi2024楼主2024/8/21 14:39

80分

#include<bits/stdc++.h>
using namespace std;
int n,ans;
string s,c;
int main()
{
	ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++)
    {
    	cin>>c;
    	if(c!="<bs>") s+=c,ans++;
    	else
		{
			if(!s.empty()) s.erase(s.size()-1);
		}
	}
	for(int i=0;i<=n;i++)
	{
		if(s[i]!=0) cout<<s[i];
	}
	return 0;
}
2024/8/21 14:39
加载中...