close

今天做了 X~X之間3的倍數 實際來講
叫做 列出區間內所有三的倍數

需要
Button * 1 → TextBox * 3 → Label * 2

程式碼如下

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a, b As Integer
a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
For i As Integer = a To b
If i Mod 3 0 Then Continue For
txtOutput.Text &= i & " "
Next
End Sub
End Class

一些可自行修改

完成後 如下圖


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 ip612256374 的頭像
    ip612256374

    ↖Ι n V a D e R ╮

    ip612256374 發表在 痞客邦 留言(0) 人氣()