## L2-053 算式拆解

题目链接：https://pintia.cn/problem-sets/994805046380707840/exam/problems/type/7?problemSetProblemId=1913922872972247048&page=1

**题目分析：还是考察栈，这道题和leetcode的括号匹配很像，具体看解法代码吧**

```cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
    stack<char> st;
    string s;
    getline(cin,s);
    vector<string> result;
    for(int i=0;i<s.length();i++){
        if(s[i]!=')'){
            st.push(s[i]);
        }
        else{
            string s="";
            while(!st.empty() && st.top()!='('){
                s+=st.top();
                st.pop();
            }
            st.pop();
            reverse(s.begin(),s.end());
            result.push_back(s);
        }
    }
    for(int i=0;i<result.size();i++){
        cout<<result[i]<<endl;
    }
    return 0;
}
