Right Answer is here!!!(我又来了)

wurenchao 2023-10-04 15:22:42 2023-10-04 15:23:36 11 返回题目

#include<bits/stdc++.h>

using namespace std;

stack bool a;//自己加尖括号,打不出来

int main(){

char n;
bool f=1;
while(cin>>n&&n!='@'){
	if(n==')'){
		if(a.empty()) f=0;
		else a.pop();
	}
	if(n=='(') a.push(1);
}
if(f&&a.empty()) cout<<"YES";
else cout<<"NO";
return 0;

}

{{ vote && vote.total.up }}