Private Sub Form_Click()
Dim a As Integer
a = Val(InputBox("输入年份"))
If a Mod 400 = 0 Then
Print "是瑞年"
ElseIf a Mod 4 = 0 And a Mod 100 <> 0 Then
Print "是瑞年 "
Else
Print "不是瑞年"
End If
End Sub
Dim yea As IntegerDim LeapYear As Boolean
yea = InputBox("请输入年号:")
If ((yea Mod 4) = 0) Then
LeapYear = ((yea Mod 100) >0) Or ((yea Mod 400) = 0)
End If
If LeapYear Then MsgBox yea &"年是闰年。" Else MsgBox yea &"不是闰年"
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)