2009年1月21日 星期三

彰商程式設計隊的99題練習題(1.將輸入之秒數轉換成「時:分:秒」)

image

image

image

 

程式碼

Public Class Form1
    Dim a As Single
    Dim s As Long
    Dim m As Long
    Dim m1 As Long
    Dim h As Long
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        a = Val(TextBox1.Text)
        If a Mod 60 > 0 Then
            s = a Mod 60
        End If
        m1 = a \ 60
        h = m1 \ 60
        m = m1 Mod 60
        TextBox2.Text = h
        TextBox3.Text = m
        TextBox4.Text = s
    End Sub
End Class

假如哪裡的程式有問題    請告訴我一聲 哪裡需要再改進  謝謝!

1 則留言: