文章

71

粉丝

97

获赞

5

访问

18.0k

头像
1501 runtimeerror 通过率75%
我要提问
发布于2024年1月29日 17:30
阅读数 221

#include<bits/stdc++.h>
using namespace std;

int main(){
    string str;
    stack<char> st;
    cin>>str;
    int length=str.length();
    for(int i=0;i<length;i++){
        if(str[i]=='['||str[i]=='('){
            st.push(str[i]);
        }else if(str[i]==']'){
            if(st.top()=='[')
                st.pop();
            else st.push(str[i]);    
        }else if(str[i]==')'){
            if(st.top()=='(')
               ...

登录查看完整内容


登录后发布评论

1 条评论
snake
2024年1月29日 22:23

你试试输入]]

赞(0)