题解 | 明天星期几?
明天星期几?
https://www.nowcoder.com/practice/9db9e3d19cde405ba94db09ed1c5f3f3
import java.util.Scanner;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
// 注意 hasNext 和 hasNextLine 的区别
int d = in.nextInt();
// [1,2,3,4,5,6,7]
System.out.println(d%7+1); // 0~6
}
}