1066: 字符分类统计
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);String s=cin.nextLine();int letter=0,digit=0,other=0;for(int i=0;i<s.length();i++){
char ch=s.charAt(i);if(ch>='a'&&ch<='z'||ch>='A'&&ch<='Z') letter++;else if(ch>='0'&&ch<='9') digit++;else other++;}System.out.printf("letter:%d\n",letter);System.out.printf("digit:%d\n",digit);System.out.printf("other:%d\n",other);}
}