救...
查看原帖
救...
471033
fanersaiwenxue楼主2021/7/21 16:04

全RE

#include<iostream>
#include<cstdio>
#include<string>
using namespace std;
string pass()
{
string s="",x;
char c;
int d;
while(cin>>c)
{
	if(c=='[')
	{
		cin>>d;
  		x=pass();
		while(d--)
		{
			s+=x;
		}
	}
	else 
	{
		if(c==']')
		{
			return s;
		}
		else s+=c;
	}
}
}
int main()
{
	cout<<pass();
	return 0;
}
2021/7/21 16:04
加载中...