Answer the question
In order to leave comments, you need to log in
Pascal task. Olympiad for schoolchildren. How to solve the problem?
The days of the week are numbered as follows: 1 - Monday, 2 - Tuesday, ..., 6 - Saturday, 7 - Sunday. Given an integer K in the range 1–365 and an integer N in the range 1–7.
Write a program that determines the number of the day of the week for the K-th day of the year, if it is known that this year January 1 was the day of the week with the number N.
Input data format
Two numbers are entered from the keyboard separated by a space — K (0 < K < 366) and
N (0 < N < 8).
Output data format
Display a single number - the number of the day of the week for the K-th day of the year.
Examples of input and output data:
Input
5 4
Output
1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question