求助! 50分!
查看原帖
求助! 50分!
1024013
mjrl_679楼主2023/8/21 20:25
#include<bits/stdc++.h>
using namespace std;
string n;
int i,top=0;
int main(){
    getline(cin,n);
    while(n[i]!='@'){
    	if(n[i]=='('){
    		top++;
		}
		if(n[i]==')'){
			if(top==1) top--;
			else break;
		}
		i++;
	}
	if(top==0) cout<<"YES";
	else cout<<"NO";
    return 0;
}
2023/8/21 20:25
加载中...