标签:
1 public class 用switch判断星期几 { 2 3 public static void main(String[] args) { 4 5 System.out.println("今天是星期几"); 6 int week=2; 7 switch (week) 8 { 9 10 case 0: 11 12 System.out.println("sunday"); 13 14 break; 15 16 case 1: 17 18 System.out.println("monday"); 19 20 break; 21 22 case 2: 23 24 System.out.println( "Tuesday"); 25 26 break; 27 28 case 3: 29 30 System.out.println("Wednesday "); 31 32 break; 33 34 case 4: 35 36 System.out.println("Thursday "); 37 38 break; 39 40 case 5: 41 42 System.out.println("Friday"); 43 44 break; 45 46 case 6: 47 48 System.out.println("Saturday"); 49 50 break; 51 52 default: 53 54 System.out.println("输入有误"); 55 56 57 58 59 } 60 61 // TODO 自动生成的方法存根 62 63 } 64 65 }
今天是星期几
Tuesday
标签:
原文地址:http://www.cnblogs.com/kingmin/p/5100519.html