cx891
幼苗
共回答了16个问题采纳率:100% 举报
Dim f, d As Boolean
hf:
Y = InputBox("请输入一个四位数的年份:")
If IsNumeric(Y) Then
If Len(Y) = 4 Then
a = Y / 4
For i = 1 To Len(a)
s = Mid(a, i, 1)
If s = "." Then
f = True
Exit For
End If
Next i
z = Y / 100
For i = 1 To Len(z)
t = Mid(z, i, 1)
If t = "." Then
d = True
Exit For
End If
Next i
If f = True Or d = False Then
MsgBox "不是闰年"
Else
MsgBox "闰年"
End If
Else: GoTo gf
End If
Else: GoTo gf
End If
Exit Sub
gf:
MsgBox "格式不正确!请重新输入!"
GoTo hf
1年前
6