Public Class Form1 Private Sub TextBox2_KeyPress(ByVal sender As Object,ByVal e As System.windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress Dim n,m,i,s,z,nm As Integer n = Val(TextBox1.Text) m = Val(TextBox2.Text) If Asc(e.KeyChar) = 13 Then If n > m Then nm = n : n = m : m = nm For i = n To m s = i If s Mod 5 = 0 Then TextBox3.Text &= " " & s z = z + 1 If z Mod 4 = 0 Then TextBox3.Text &= vbCrLf End If End If Next i End If End Sub Private Sub Form1_Load(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles MyBase.Load End SubEnd Class总结
以上是内存溢出为你收集整理的VB学习第八周--特定范围内能被5整除的数全部内容,希望文章能够帮你解决VB学习第八周--特定范围内能被5整除的数所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)