| 比赛 | 
    20251022赛前模拟1 | 
    评测结果 | 
    WWWWWWWWWW | 
    | 题目名称 | 
    解压缩 | 
    最终得分 | 
    0 | 
    | 用户昵称 | 
    我常常追忆未来 | 
    运行时间 | 
    0.028 s  | 
    | 代码语言 | 
    C++ | 
    内存使用 | 
    3.67 MiB  | 
    | 提交时间 | 
    2025-10-22 10:01:28 | 
显示代码纯文本
#include <bits/stdc++.h>
using namespace std;
stack<char>d;
string s,t;
int main(){
	freopen("extract.in","r",stdin);
	freopen("extract.out","w",stdout);	
	cin>>s;
	for(int i=0;i<s.size();i++){
		d.push(s[i]);
		if(s[i]==']'){
			while(!d.empty()&&d.top()!='['){
				if(d.top()==']'){
					d.pop();
					continue;
				}				
				if(isdigit(d.top())){
					t=t+t;
				}
				else{	
					t=d.top()+t;
				}
				d.pop();
			}
		}
	}
	cout<<t;
	return 0;
}