没考虑到递归的写法。
T4
#include <bits/stdc++.h>
using namespace std;
char c;
string read(){
string s1 = "";
while(cin >> c){
if(c == '['){
int n;
cin >> n;
string s2 = read();
while(n --) s1 = s1 + s2;
}else if(c == ']') return s1;
else s1 = s1 + c;
}
return s1;
}
int main(){
cout << read();
return 0;
}