80分大佬求订
2026-09-27 17:57:32
发布于:北京
7阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
stack<char> st;
int main(){
string s;
cin>>s;
int cnt=0;
for(int i=0;i<s.size();i++){
if(s[i]=='(')
st.push('(');
else{
if(!st.empty())
st.pop();
else
cnt++;
}
}
cout<<(cnt+st.size())/2<<endl;
}
我到底哪错了T_T
这里空空如也








有帮助,赞一个