文章
71
粉丝
142
获赞
5
访问
52.9k
#include<iostream>
#include<cstring>
#include<stack>
#include<cstdio>
using namespace std;
int main() {
for (int j = 1; j <= 6; j++) {
string st;
cin >> st;
stack<char> s;
int length = st.size();
for (int i = 0; i < length; i++) {
if (st[i] == '[' || st[i] == '('||st[i]=='<'||st[i]=='{')
s.push(st[i]);
else if ((st[i] == ']' || st[i] == ')'||st[i] == '>' || st[i] == '}') && s.empty()) {
&...
登录后发布评论
for循环括号范围有问题