题解 | #统计大写字母个数#
统计大写字母个数
http://www.nowcoder.com/practice/434414efe5ea48e5b06ebf2b35434a9c
#include<iostream>
using namespace std;
int main()
{
string str;
while(getline(cin,str))
{
int i=0;
int count=0;
while(str[i]!='\0')
{
if(str[i]>='A'&& str[i]<='Z')
{
count++;
}
i++;
}
cout<<count<<endl;
}
return 0;
}