90分RE求调
查看原帖
90分RE求调
1536432
lbw318楼主2024/11/21 13:07

#8 RE了

#include<bits/stdc++.h>
#include <stack>
using namespace std;
int main(){
	string a;
    int i=0;
    int left=0,right=0;
	while(a[i]!='@'){
	    i++;
		cin>>a[i];
		if(a[i]=='(') left++;
		if(a[i]==')') right++;
		if(right>left) break;
	}
	if(left==right){
		cout<<"YES";
	}
	else{
		cout<<"NO";
	} 
	return 0;
}

2024/11/21 13:07
加载中...