- 再来个C++版本
#include <iostream>
#include <string>
using namespace std;
int main() {
int cnt = 0;
string s;
while (getline(cin, s)) { // 注意 while 处理多个 case
for (char ch : s) {
if (isupper(ch)) {
cnt ++;
}
}
cout << cnt << endl;
}
}
// 64 位输出请用 printf("%lld")



京公网安备 11010502036488号