求助找下错误、、、
任意给一年,判断该年是否为闰年?并根据给出的月份来判断是什么季节和该月有多少天?、、、、新手求助!代码
Private Sub Command1_Click()
Dim a As Integer, b As Integer, c As Integer
a = Val(Text1.Text)
b = Val(Text2.Text)
If (a Mod 4 = 0 And a Mod 100 <> 0) Or (a Mod 400 = 0) Then
Label3.Caption = "闰年"
Else
Label3.Caption = "非闰年"
End If
Select Case b
Case 3 To 5
Label4.Caption = "春季(spring)"
Case 6 To 8
Lable4.Caption = "夏季(summer)"
Case 9 To 11
Label4.Caption = "秋季(autumn)"
Case 12, 1, 2
Label4.Caption = "冬季(winter)"
End Select
Select Case b
Case 1, 3, 5, 7, 8, 10, 12
Label5.Caption = "31天!"
Case 4, 6, 9, 11
Label5.Caption = "30天!"
Case 2
If (a Mod 4 = 0 And a Mod 100 <> 0) Or (a Mod 400 = 0) Then
Label5.Caption = "29天!"
Else
Label5.Caption = "28天!"
End If
End Select
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Label3.Caption = ""
Label4.Caption = ""
Label5.Caption = ""
End Sub