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

统计大写字母个数

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

const rl = require("readline").createInterface({input:process.stdin});
var iter = rl[Symbol.asyncIterator]();
const readline = async() => (await iter.next()).value;

void async function(){
    const str = await readline();
    let cnt = 0;
    for(const c of str){
        if(c<="Z" && c>= "A") cnt ++;
    }
    console.log(cnt);
}()

华为OD,我昵称“od400” 文章被收录于专栏

华为OD机试刷题历程,因涉及华为权益,牛客不允许更新了。我昵称“od400”,某博客继续更新。

全部评论

相关推荐

点赞 评论 收藏
分享
评论
2
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务