The date consists of three int data, namely year, month, day. You cannot use any function, just use the simplest if to judge. Does anyone have any simple method?
Routine: if is nested inside if, if year is equal, determine month, and then determine day
Direct year1000000 month100 day One if can be done
Just convert year month day into string, then add them and compare them, just like sorting. Note that month and day must be two digits, and 0 is added for one digit
If you consider the simplicity of the code, then your method is indeed good, but from a performance perspective, three ifs are much more efficient than multiplication