#t7. 后天是星期几
后天是星期几
The Day After Tomorrow
Problem Description
We use the numbers through to represent Monday through Sunday respectively. Given the number of a certain day, compute and output the number of that day's "day after tomorrow".
Input Format
The first line gives a positive integer (), representing a day of the week.
Output Format
Output the weekday number of that day's day-after-tomorrow on one line.
Sample Input 1
3
Sample Output 1
5
Sample Input 2
6
Sample Output 2
1
Hint
- There is no weekday ! After adding , values exceeding must wrap back to .
- Think about how the modulo operator
% 7helps you wrap around — taking(n+2) % 7directly is wrong; try counting weekdays starting from first. - Check against the samples:
3→5;6→1.
相关
在以下作业中: