用Java写、题目:输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数。相关知识点: 试题来源: 解析 import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;芝士回答,社版权建必究,未元经许可,除不而得转载public class zifu {public static void main(String[]...
} System.out.println("数字个数:"+num+"\n字母个数:"+letter+"\n空格个数:"+space+"\n其他字符个数:"+other);
String charVar;// 该变量用来接收输入的字符 System.out.print("请输入任意字符:"); Scanner sc = new Scanner(System.in); int yingwen = 0; int kongge = 0; int shuzi = 0; int qita = 0; charVar = sc.next(); // 取输入的第一个字符 int i = 0; while (i < charVar....
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;public class zifu { public static void main(String[] args) { System.out.println("请输入:(结束请按回车)");InputStreamReader isr = new InputStreamReader(System.in);BufferedReader br= new Buffere...