p1928输入输出问题求助
  • 板块题目总版
  • 楼主zyx1130
  • 当前回复1
  • 已保存回复1
  • 发布时间2023/3/26 19:13
  • 上次更新2023/10/23 20:23:12
查看原帖
p1928输入输出问题求助
503583
zyx1130楼主2023/3/26 19:13

代码运行的时候不输出答案,但提交AC了。求助dalao为什么QAQ

#include<bits/stdc++.h>
using namespace std;
string expand(){
	string s="",X;
	char c;int D;
	while(cin>>c){
		if(c=='['){
			cin>>D;
			X=expand();
			while(D--) s+=X;
		}
		else if(c==']')
			return s;
		else s+=c;
	}
	return s;
}
int main()
{
	//freopen("p1928.in","r",stdin);
	//freopen("p1928.out","w",stdout);
	cout<<expand();
	return 0;
}
2023/3/26 19:13
加载中...