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
扫码备注加群即可,期待您的到来~
By signing up a CodeFun2000 universal account, you can submit code and join discussions in all online judging services provided by us.