Programming contests

50 Programming Exercise for Beginners

January 2, 2019 12:00 AM – December 31, 2019 12:00 AM

Which day?

Write a program that reads dates in „MM.DD.” format from the standard input until either MM or DD is zero. The program should write the name of the day to the standard output for each line.
On which day does the given date fall? We can assume that the first day of the year falls on Monday, and the year is not a leap year. See the English names of the days in the sample output.

Sample Input

  1. 01.01.
  2. 03.13.
  3. 10.17.
  4. 12.27.
  5. 08.17.
  6. 04.21.
  7. 07.15.
  8. 00.05.
download as text file

Output for Sample Input

  1. Monday
  2. Tuesday
  3. Wednesday
  4. Thursday
  5. Friday
  6. Saturday
  7. Sunday
download as text file

Possible solutions: main1.c and main2.c.

Acknowledgement This work was supported by the construction EFOP-3.4.3-16-2016-00021. The project was supported by the European Union, co-financed by the European Social Fund.
University of Debrecen; Faculty of Informatics; v. 03/01/2019