1. 题目
读题
考查点
2. 解法
思路
代码逻辑
具体实现
public class HJ084 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println(countUpper(sc.nextLine()));
}
public static int countUpper(String str) {
int cnt = 0;
for (char c : str.toCharArray()) {
if (c >= 'A' && c <= 'Z') {
cnt++;
}
}
return cnt;
}
}
3. 总结
标签:cnt,int,个数,大写字母,HJ84,public From: https://www.cnblogs.com/shoshana-kong/p/17542183.html