文章
6
粉丝
133
获赞
7
访问
25.0k
#include<iostream>
#include<stack>
#include<vector>
#include<string>
using namespace std;
string judgestring(string str)
{
stack<char>stk;
int len = str.length();
for (int i = 0; i < len; i++)
{
if (char(str[i]) == '[' || char(str[i]) == '{' || char(str[i]) == '(')
{
stk.push(char(str[i]));
}
else if (char(str[i]) == ']' || char(str[i]) == '}' || char(str[i]) == ')')
{
if (stk.size() == 0)
{
...
登录后发布评论
暂无评论,来抢沙发