# Author: Steven Carr # Last Edited: October 2021 # Calculates day of the week and uses conditionals to print what the day is import stdio import sys import math # User input for month, day and year m = int(sys.argv[1]) d = int(sys.argv[2]) y = int(sys.argv[3]) # Equations to determine day of the week from 0 to 6 year1 = y - (14-m)//12 x = year1 + year1//4 - year1//100 + year1//400 month1 = m + 12 * ((14 - m) // 12) - 2 dow = (d + x + 31 * month1 // 12) % 7 # Translate the number to corresponding day of the week # (0 to Sunday, 6 to Saturday) if dow == 0: stdio.writeln('Sunday') if dow == 1: stdio.writeln('Monday') if dow == 2: stdio.writeln('Tuesday') if dow == 3: stdio.writeln('Wednesday') if dow == 4: stdio.writeln('Thursday') if dow == 5: stdio.writeln('Friday') if dow == 6: stdio.writeln('Saturday')