RE???
查看原帖
RE???
638718
xueruo楼主2022/11/5 13:02
#include<iostream>
#include<cstring>
#include<stack>
using namespace std;
stack<char>s;
char a;
int main(){
	while((a=getchar())!='@'){
		if(a=='(')s.push(a);
		if(a==')'){
			if(s.top()!='('){
				cout<<"NO";
				return 0;
			}else{
				s.pop();
			}
		}
	}
	if(!s.empty()){
		cout<<"NO";
		return 0;
	}
	cout<<"YES";
	return 0;
}
2022/11/5 13:02
加载中...