《 题 解 》
2023-07-16 11:10:40
发布于:浙江
46阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
string a;
char x;
int top=0;
while(cin>>x){
if(x=='@'){
break;
}
if(top==0){
if(x==')'){
cout<<"NO";
return 0;
}
}
if(x=='('){
a[++top]=x;
}
if(x==')'){
top--;
}
}
if(top==0){
cout<<"YES";
}else{
cout<<"NO";
}
return 0;
}
这里空空如也
有帮助,赞一个