📄 4011850_ac_219ms_692k.cpp
字号:
#include <string>
#include <ctype.h>
#include <iostream>
#include <algorithm>
using namespace std;
string exp;
int pos;
string res[10000];
void go(int p)
{
res[p] += exp.at(pos--);
if (islower(exp.at(pos + 1)))
{
return ;
}
go(p + 1);
go(p + 1);
}
int main()
{
int cas, i;
cin >> cas;
while (cas-- != 0)
{
cin >> exp;
pos = exp.length() - 1;
for (i = 0; i <= pos; i++)
{
res[i] = "";
}
go(0);
for (i = exp.length() - 1; i >= 0; i--)
{
cout << res[i];
}
cout << endl;
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -