输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数。 import java.util.Scanner;class Demo{public static void main(String[] args){count();}public static void count() {Scanner in = new Scanner(Sys
import java.util.Scanner; class Demo{ public static void main(String[] args){ count(); } public static void count() { Scanner in = new Scanner(System.in); int letterCount=0; int spaceCount=0; int numCount=0; int otherCount=0; System.out.println("inp a String"); String str = in.nextLine(); char[] c = str.toCharArray(); for(int i = 0;i