#include <bits/stdc++.h>
using namespace std;
int main(){
stack <char> s;
char x;
while(cin >> x){
if(x == '@')
break;
if(x == '(')
s.push(x);
if(x == ')'){
if(s.empty()){
cout << "NO" << endl;
return 0;
}else
s.pop();
}
}
if(s.empty())
cout << "YES" << endl;
else
cout << "NO" << endl;
return 0;
}
P1739表达式括号匹配
最新推荐文章于 2024-08-21 18:16:36 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)