用vb编写一个程序,判断某年是不是闰年
发布网友
发布时间:2024-09-27 09:49
我来回答
共3个回答
热心网友
时间:2024-10-05 01:02
Function IsLeapYearA(ByVal yr As Integer) As Boolean
If ((yr Mod 4) = 0) Then
IsLeapYearA = ((yr Mod 100) > 0) Or ((yr Mod 400) = 0)
End If
End Function
Private Sub Command1_Click()
If IsLeapYearA(Val(Text1.Text)) Then
Print Text1.Text & "年是闰年"
Else
Print Text1.Text & "年不是闰年"
End If
End Sub
Private Sub Form_Load()
Text1.Text = ""
End Sub
热心网友
时间:2024-10-05 00:59
垃圾
热心网友
时间:2024-10-05 00:59
dim year as interger'判断是否是闰年
if (year mod 4=0 and year mod 100<>0 ) or year mod 400=0 _
then print year;"是闰年"
else print year;"不是闰年"
endif
for i=1 to 100'for循环 求1+2+……+100的和
sum = sum +i
next