#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-06-16 21:30:25 发布