题解 | #统计大写字母个数#
统计大写字母个数
http://www.nowcoder.com/practice/434414efe5ea48e5b06ebf2b35434a9c
let str ;
while(str = readline()){
//+? 禁止贪婪
let res = str.match(/[A-Z]+?/g);
if(res){
console.log(res.length)
}else{
console.log(0)
}
} 统计大写字母个数
http://www.nowcoder.com/practice/434414efe5ea48e5b06ebf2b35434a9c
let str ;
while(str = readline()){
//+? 禁止贪婪
let res = str.match(/[A-Z]+?/g);
if(res){
console.log(res.length)
}else{
console.log(0)
}
} 相关推荐

