#include<bits/stdc++.h>
using namespace std;
string s;
int main()
{
cin >> s;
int cnt1 , cnt2;
for(int i = 0; i < s.size(); i++)
{
if(s[i] == '(')
{
cnt1++;
}
if(s[i] == ')')
{
cnt2++;
}
}
cout << cnt1 << " " << cnt2 << endl;
if(cnt1 == cnt2)
{
cout << "YES" << endl;
}
else
{
cout << "NO" << endl;
}
return 0;
}
哪里错了!