题解 | #统计大写字母个数#

统计大写字母个数

https://www.nowcoder.com/practice/434414efe5ea48e5b06ebf2b35434a9c

#include <iostream>
#include <string>
using namespace std;

int main() {
    string input;
    while (getline(cin,input)) {
        int count=0;
        for(auto & i:input){
            if((int)i >= (int)'A'&&(int)i <= (int)'Z'){
                count++;
            }
        }
        cout<<count<<endl;
    }
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

04-15 14:28
已编辑
Java
程序员小白条:学院+两段经典项目+技术栈,最大众的简历,纯看运气
点赞 评论 收藏
分享
04-15 09:59
门头沟学院 C++
yy_11:小公司人家没必要泄密,大公司都是本地部署了
你想吐槽公司的哪些规定
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务