import java.util.Scanner;
public class WeekTest {
public static void main(String []args){
Scanner sc=new Scanner(System.in);
System.out.println("请输入今天星期几 : ");
int day = sc.nextInt();
System.out.println("请输入天数 : ");
int n = sc.nextInt();
day = (day+n)%7;
System.out.println(day+"天后是星期 " + day);
}
}
public static void main(){
Scanner sc=new Scanner(System.in);
System.out.println("请输入今天星期几 : ");
int day = sc.nextInt();
System.out.println("请输入天数 : ");
int n = sc.nextInt();
n = n % 7;
day = day + n;
System.out.println("请输入今天星期 : " + day);
}
别忘记引入scanner