public class TestDay {
public static void main(String[] args) {
System.out.println("请输入数据:");
int input = new Scanner(System.in).nextInt();
if(input == 1) {
System.out.println("星期一");
}else if(input == 2){
System.out.println("星期二");
}else if(input == 3){
System.out.println("星期三");
}else if(input == 4){
System.out.println("星期四");
}else if(input == 5){
System.out.println("星期五");
}else if(input == 6){
System.out.println("星期六");
}else if(input == 7){
System.out.println("星期日");
}
}
}
用数字来表示星期几
最新推荐文章于 2024-08-24 17:09:16 发布