You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
You are given a date, year month day.Return the weekday of the date.
For clarification: A given year n is a leap year if it fulflls all following conditions:
i.e.
1996 is a leap year // 1996 is divisible by 4
2000 is a leap year // 2000 is divisible by 4, 100 and 400
2100 is a normal year // 2100 is divisible by 4, 100 but not divisible by 400
Assume that this rule has been in use since the start of the year system, e.g. year 4 is considered a leap year for purposes of this question.
Input:
1000<=year<=5000
1<=month<=12
1<=day<=31
Output
0<= weekday <= 6
0-6 Representing Monday Tuesday Wednesday Thursday Friday Saturday Sunday
Input
2022 7 30
Output
5
本题属于以下题库,请选择所需题库进行购买