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

统计大写字母个数

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

 Scanner scanner = new Scanner(System.in); while (scanner.hasNext()){ String nextLine = scanner.nextLine(); char[] charArray = nextLine.toCharArray(); int count = 0; for (char c:charArray ) { if(c>= 'A' && c <= 'Z'){
                    count++;
                }
            } System.out.println(count);
        }
    }
}
全部评论

相关推荐

07-04 16:00
门头沟学院 Java
点赞 评论 收藏
分享
zhch7:建议9✌️把学历加黑加粗,如果实在offer可能是觉得佬不会去
投了多少份简历才上岸
点赞 评论 收藏
分享
05-29 09:02
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
1
分享

创作者周榜

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