import java.util.Scanner;
class Demo6 {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.println("输入多少号");
int x = sc.nextInt();
if(x<1||x>31)
System.out.println("没有这个号");
else if(x%7==1)
System.out.println("星期一");
else if(x%7==2)
System.out.println("星期二");
else if(x%7==3)
System.out.println("星期三");
else if(x%7==4)
System.out.println("星期四");
else if(x%7==5)
System.out.println("星期五");
else if(x%7==6)
System.out.println("星期六");
else
System.out.println("星期日");
}
} |
|