AC
2023-07-26 11:04:32
发布于:广东
7阅读
0回复
0点赞
#include<iostream>
using namespace std;
int main(){
    string a;
    int i = 0,top = 0,tmp = 0;
    cin >> a;
    while(a[i] != '@'){
        if(a[i] == '(')top++;
        if(a[i] == ')')top--;
        if(top < 0){
            tmp = 1;
            break;
        }
        i++;
    }
    if(top != 0)tmp = 1;
    if(tmp == 0)cout << "YES";
    else cout << "NO";
    return 0;
}
这里空空如也

有帮助,赞一个