为什么错!!!!!!求助大大大佬!!!
查看原帖
为什么错!!!!!!求助大大大佬!!!
1073177
Peruere楼主2023/10/9 12:45
#include<bits/stdc++.h>

using namespace std;

string ex(){
	string s="",X;
	char c;int D;
	while(cin>>c){
		if(c=='['){
		cin>>D;
		X=ex();
		while(D--) s+=X;
	}
	else if(c==']')
		return s;
	else s+=c;
}
	return s;
	}
int main(){
	cout<<ex();
	return 0;
} 
2023/10/9 12:45
加载中...