import java.util.Scanner;public class MyClass { public static void main(String[] args) { Scanner scanf = new Scanner(System.in);System.out.println("请输入字符属串:");String str = scanf.nextLine();scanf.close();char c = str.charAt(0);System.out.print("第一个字符为");if...
如果是第一个字符为大写字符则输出该字符为大写字母,如果是大写字符则输出该字符为小写字母,如果是数字字符则输出该字符为数字字符,否则输出其他字符... (用if语句)键盘输入一个字符串,通过第一个字符来判断该字符是大写字母、小写字母、数字、还是其他字符。如果是第一个字符为大写字符则输出该字符为大写字母,如果...
import java.util.Scanner;public class MyClass {public static void main(String[] args) {Scanner scanf = new Scanner(System.in);System.out.println("请输入字符串:");String str = scanf.nextLine();;scanf.close();char c = str.charAt(0);System.out.print("第一个字符为");if(c...
import java.util.Scanner;public class Validator { public static void main(String[] args) { Scanner scanner = new Scanner(System.in);String str = scanner.nextLine().trim();if(str.length() > 1){ System.out.println("输入的是字符串");}else if(str.matches("[a-z]")){ Syste...