Private Sub Command1_Click()
n = Val(Text1.Text)

s = 0

i = 1

Do While i <= n

s = s + i

i = i + 1

Loop

Label1 = s


End Sub

Private Sub Command2_Click()
n = Val(Text1.Text)

s = 0

i = n

Do While i > 0

s = s + i

i = i - 1

Loop

Label1 = s

End Sub

Private Sub Command3_Click()
n = Val(Text1.Text)

s = 0

i = 1

Do While i <= n

s = s + i

i = i + 2

Loop

Label1 = s

End Sub

arrow
arrow
    全站熱搜

    a12s23d45f56asdf 發表在 痞客邦 留言(1) 人氣()