为何本地无法正常输出,洛谷却能ac
查看原帖
为何本地无法正常输出,洛谷却能ac
922528
jeamark_233楼主2023/5/5 17:22
#include <iostream>
#include <string>
using namespace std;
string zi()
{
	string s="",x;
	char c;
	int d;
	while(cin>>c)
	{
		if(c=='[')
		{
			scanf("%d",&d);
			x=zi();
			while(d--)
			{
				s+=x;
			}
		}
		else
		{
			if(c==']')
			{
				return s;
			}
			else
				s+=c;
		}
	}
	return s;
}
int main()
{
	cout<<zi();
}

程序如上,拿AC[3FUN]为例子,在本地无法正常输出ACFUNFUNFUN,但洛谷中ac了

2023/5/5 17:22
加载中...