. 1 Package FushiExam; 2 Import Classes in java.util *. ; . 3 public class Text_26 { . 4 . 5 public static void main (String [] args) { . 6 / * . 7 * Please enter the first letter of the week to determine what day of the week, 8 * same as the first letter, the second letter is determined, and so on . 9 * / 10 System.out.println ( "enter first letter:" ); . 11 Switch (getletter ()) { 12 is Case 'm ' : 13 is Case ' M ' : 14 System.out.println ( "catalog on Monday"); 15 break; 16 case 't': 17 case 'T': 18 System.out.println("输入第二个字母:"); 19 char t=getletter(); 20 if(t=='u'||t=='U') 21 System.out.println("Tuesday"); 22 else if(t=='h'||t=='H') 23 System.out.println("Thursday"); 24 else 25 System.out.println("error"); 26 break; 27 case 'w': 28 case 'W': 29 System.out.println("Wednesday"); 30 break; 31 case 'f': 32 System.out.println("Friday"); 33 break; 34 case 's': 35 case 'S': 36 char t1=getletter(); 37 if(t1=='u'||t1=='U') 38 System.out.println("Sunday"); 39 else if(t1=='a'||t1=='A') 40 System.out.println("Saturday"); 41 else 42 System.out.println("error"); 43 break; 44 default: 45 System.out.println("error"); 46 } 47 48 49 } 50 public static char getletter() { 51 Scanner scan=new Scanner(System.in); 52 String letter=scan.nextLine(); 53 char[] arr=letter.toCharArray(); 54 return arr[0]; 55 } 56 57 }