2009年3月5日 星期四

99-7彰商

image

Public Class Form1
    Dim a, b, j, i
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        a = Val(TextBox1.Text)
        b = Val(TextBox1.Text)
        j = 0
        For i = 1 To a Step 1
            j = j + i
        Next
        b = j
        TextBox2.Text = b
    End Sub
End Class

沒有留言:

張貼留言