//统计大写字母个数
#include <iostream>
#include <string>
using namespace std;
int CalcCapital(string str)
{
if (str.size() == 0)
{
cout << 0 << endl;
return 0;
}
int count = 0;
for (int i = 0; i < str.size(); i++)
{
if (str[i] >= 'A' && str[i] <= 'Z')
count++;
}
cout << count << endl;
return 0;
}
int main()
{
string s;
getline(cin, s);
CalcCapital(s);
return 0;
}
统计大写字母个数
最新推荐文章于 2023-12-19 14:55:14 发布