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

统计大写字母个数

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 () {
    // Write your code here
  const str = await readline()
  const upperLength = str.split(/[^A-Z]+/)
   let upperCount = 0
   for(let i=0; i<upperLength.length; i++) {
     upperCount += upperLength[i].length
     
   }
   console.log(upperCount)
}()

全部评论

相关推荐

2025-11-28 16:00
已编辑
武汉理工大学 Java
点赞 评论 收藏
分享
01-05 09:14
同济大学 Java
不要盒我呀:我要是9✌🏻我就选保研,保研了大四再找实习,实习之后,如果觉得自己不适合互联网工作模式,还能有其他选择,如果实习后决定了走互联网,也能提升学历提高竞争力
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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