import java.util.Scanner; public class bigLetterCount { public static int CalcCapital(String str){ int count=0; for(int i=0;i<str.length();i++){ if('A'<=str.charAt(i)&&str.charAt(i)<='Z')count++; } return count; } public static void main(String args[]){ Scanner input=new Scanner(System.in); String s=input.nextLine(); System.out.println(CalcCapital(s)); } }
华为OJ:字母大小写判断
时间: 2024-10-10 13:07:58