题目链接:统计大写字母个数_牛客题霸_牛客网
#include<iostream>
#include<cstring>
#include<cctype>
using namespace std;
int main(){
string str;
int cnt = 0;
while (getline(cin,str)){
for(int i = 0; i < str.size(); ++i){
if( isalpha(str[i]) && (str[i] >= 'A' && str[i] <= 'Z')) cnt++;
}
cout << cnt <<endl;
}
return 0;
}