Problem Description
从键盘上输入数字星期,然后输出它的英文。
其对应关系是:
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday
7 Sunday
其对应关系是:
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday
7 Sunday
Input
从键盘输入数字星期,输入数字在1-7之间。
Output
输出该数字对应的英文星期表示。
Example Input
2
Example Output
Tuesday
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner reader=new Scanner(System.in); int n; n=reader.nextInt(); switch(n) { case 1: System.out.println("Monday"); break; case 2: System.out.println("Tuesday"); break; case 3: System.out.println("Wednesday"); break; case 4: System.out.println("Thursday"); break; case 5: System.out.println("Friday"); break; case 6: System.out.println("Saturday"); break; case 7: System.out.println("Sunday"); break; } } }