C++ 灵能弹引爆判断 - 字符串分析算法 日期: 2028-01-21 标签: 常规 #include #include using namespace std; string s; int main() { cin >> s; int cnt0 = 0, cnt1 = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == '0') cnt0++; else cnt1++; } if (cnt0 > cnt1) cout << 'yes'; else cout << 'no'; return 0; } 原文地址: https://www.cveoy.top/t/topic/oUkk 著作权归作者所有。请勿转载和采集! 免费AI点我,无需注册和登录