Files
python/TangDou/XiTi/1390.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

25 lines
522 B
C++

#include <bits/stdc++.h>
using namespace std;
int main() {
//输入+输出重定向
//freopen("../x.in", "r", stdin);
//freopen("../x.out", "w", stdout);
string s;
getline(cin, s);
stack<char> st;
for (int i = 0; i < s.size(); ++i) {
if (s[i] == '(') st.push('(');
if (s[i] == ')') st.pop();
}
if (st.empty()) cout << "YES" << endl;
else cout << "NO" << endl;
//关闭文件
//fclose(stdin);
//fclose(stdout);
return 0;
}