import java.util.Scanner;
public class exam1_1{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
char[]number=null;
int shuru=0;
int letters=0;
int kongge=0;
int other=0;
System.out.println("请输入一行文字:");
String num=input.nextLine();
number=num.toCharArray();
for(int i=0;i<number.length;i++) {
if(number[i]>='0'&&number[i]<='9') {
shuru++;
}else if((number[i]>='a'&&number[i]<='z')||(number[i]>'A'&&number[i]<'Z')) {
letters++;
}else if(number[i]==' ') {
kongge++;
}else {
other++;
}
}
System.out.println("数字个数:"+shuru);
System.out.println("英文个数:"+letters);
System.out.println("空格个数:"+kongge);
System.out.println("其他个数:"+other);
}
}
public class exam1_1{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
char[]number=null;
int shuru=0;
int letters=0;
int kongge=0;
int other=0;
System.out.println("请输入一行文字:");
String num=input.nextLine();
number=num.toCharArray();
for(int i=0;i<number.length;i++) {
if(number[i]>='0'&&number[i]<='9') {
shuru++;
}else if((number[i]>='a'&&number[i]<='z')||(number[i]>'A'&&number[i]<'Z')) {
letters++;
}else if(number[i]==' ') {
kongge++;
}else {
other++;
}
}
System.out.println("数字个数:"+shuru);
System.out.println("英文个数:"+letters);
System.out.println("空格个数:"+kongge);
System.out.println("其他个数:"+other);
}
}