public class Test01 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("请输入带字母的字符串:");
String s = input.nextLine();
int countAlpha = 0; // 统计字母出现的次数
int countUpper = 0; // 统计大写字母出现的次数
while (true) {
for (int i = 0; i < s.length(); i++) {
char ch = s.charAt(i);
if (Character.isLetter(ch)) {
countAlpha++;
}
if (Character.isUpperCase(ch)) {
countUpper++;
}
}