题解 | #统计大写字母个数#
统计大写字母个数
https://www.nowcoder.com/practice/434414efe5ea48e5b06ebf2b35434a9c
#include <iostream> #include <string> using namespace std; int main() { string s; getline(cin, s); int ans = 0; for (char c : s) { if (c >= 'A' && c <= 'Z') ans++; } cout << ans; } // 64 位输出请用 printf("%lld")