2009年4月24日 星期五

閏年判斷

image

'閏年判斷
'西元年被4整除且不被100整除,或被400整除者即為閏年

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim rStr = ""
        Dim y() = {1995, 1996, 1900, 2000}
        For i As Integer = 0 To UBound(y)
            Dim msg = "非閏年"
            If y(i) Mod 4 = 0 Then msg = "閏年"
            If y(i) Mod 100 = 0 Then msg = "非閏年"
            If y(i) Mod 400 = 0 Then msg = "閏年"
            rStr = rStr & msg & vbNewLine
        Next
        MsgBox(rStr)
    End Sub
End Class

1 則留言:

  1. ChoeBet Casino Site - Review, Ratings, Bonuses
    Check 메리트 카지노 쿠폰 out ChoeBet casino febcasino review. 카지노사이트 ChoeBet casino is one of the best online casinos that offers real money casino games to players worldwide.

    回覆刪除