这是我的代码:
#include<bits/stdc++.h>
using namespace std;
string expend() {
char c;
string ans, st = "";
while(cin >> c){
if(c == '['){
int a;
cin >> a;
st = expend();
while(a--)ans += st;
}
else if(c == ']')
return ans;
else
ans += c;
}
return ans;
}
int main () {
cout << expend() << endl;
return 0;
}
在电脑上是这样运行的的:

竟然没有没有输出结果?!为何如此,求大佬来看一下!