整点简单的哈哈哈
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <stack>
using namespace std;
int main()
{
stack<char> s;
char c;
int flag=0;
while((c=getchar())!='\n')
{
if(c=='{'||c=='['||c=='(')
{
s.push(c);
continue;
}
if(c=='}')
{
if(!s.empty()&&s.top()=='{')
{
s.pop();
continue;
}
else
{
flag=1;
break;
}
}
if(c==']')
{
if(!s.empty()&&s.top()=='[')
{
s.pop();
continue;
}
else
{
flag=1;