不是吧,这个算法在学c语言的时候,是书上的例子啊! Function IsLeapYear(ByVal yr As Integer) As Boolean If ((yr Mod 4) = 0) Then IsLeapYear = ((yr Mod 100) > 0) Or ((yr Mod 400) = 0) End If End Function
Function IsLeap(sYear As long) As Boolean If (syear mod 4=0 and syear mod 100<>0) or (syear mod 400=0) Then IsLeap = True Else IsLeap = False End If End Function
Function IsLeapYear(ByVal yr As Integer) As Boolean
If ((yr Mod 4) = 0) Then
IsLeapYear = ((yr Mod 100) > 0) Or ((yr Mod 400) = 0)
End If
End Function
If (syear mod 4=0 and syear mod 100<>0) or (syear mod 400=0) Then
IsLeap = True
Else
IsLeap = False
End If
End Function