为什么劳玩家一回归就送我一个60分大礼包啊
查看原帖
为什么劳玩家一回归就送我一个60分大礼包啊
1074812
Jared0503楼主2024/6/28 22:04
#include<bits/stdc++.h>
using namespace std;
stack<char> test;
int main()
{
	int n;
    char s,b[101];
    cin>>n;
    for(int i=0;i<n;i++)
    {
    	cin>>s;
    	if(s=='<') test.pop();
    	else if(s==' ') continue;
    	else test.push(s);
	}
	int i=0;
	while(!test.empty())
	{
		b[i++]=test.top();
		test.pop();
	}
	for(;i-1>=0;i--)
	{
		cout<<b[i-1];
	}
}

我寻思这代码好像没啥问题啊,为啥会是60分你呢?

太久没刷题了,做不出来正常,求教!!!

2024/6/28 22:04
加载中...