for (int k = 0; k < input.length(); k++) { // Check for uppercase letters. if (Character.isUpperCase(input.charAt(k))) upperCase++; // Check for lowercase letters. if (Character.isLowerCase(input.charAt(k))) lowerCase++;}System.out.printf("There are %d uppercase letters and %d lowercase letters.",upperCase,lowerCase);
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)