#include<cstdio>
#include<iostream>
#include<stack>
#include<cstring>
#include<algorithm>
#include<queue>
using namespace std;
stack<char> S;
stack<char> Q;
int main()
{
char s[100];
gets(s);
int l = strlen(s);
for(int i=l-1;i>=0;i--)
S.push(s[i]);
while(!S.empty()){
if(S.top()=='B') printf("tsaedsae");
if(S.top()=='('){
S.pop();
char c = S.top();
while(S.top()!=')'){
S.pop();
Q.push(S.top());
}
Q.pop();
while(!Q.empty()){
printf("%c%c",c,Q.top());
Q.pop();
}
printf("%c",c);
}
S.pop();
}
return 0;
}
魔王语言
最新推荐文章于 2022-01-17 21:41:03 发布