文章
37
粉丝
98
获赞
4
访问
22.5k
#include<iostream>
#include<algorithm>
#include<stack>
#include<string>
using namespace std;
int main()
{
int n,cnt=0;
cin >> n;
stack<char> stac;
string ans[100];
for (int j = 0; j < n; j++) {
int flag = 0;//标记是否是优先级导致的NO
string s;
cin >> s;
int len = s.size();
for (int i= 0; i < len; i++) {
if (!stac.empty()) {
char now = stac.top();
if ((s[i] == ')' && now == '(') || (s[i] == ']' && now =...
登录后发布评论
暂无评论,来抢沙发