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

創作者介紹
創作者 a12s23d45f56asdf 的頭像
a12s23d45f56asdf

遙遠北方

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


留言列表 (1)

發表留言
  • dion513
  • 這是啥
    看沒,C code嗎