VB编程text1,2输入n1,n2,计算出n1n2间所有数不包括n1n2 20
展开全部
我觉得你应该是计算这之间的素数
自己在窗体上添加控件之后直接用程序即可
做加法:所有的数做加法
Private Sub Command1_Click()
Dim a As Integer, b As Integer, i As Integer, s As Integer
a = Text1.Text
b = Text2.Text
s = 0
For i = a + 1 To b - 1
s = s + i
Next i
Print s
End Sub
所有的素数的程序为:
Private Sub Command1_Click()
Dim a As Integer, b As Integer, i As Integer, s As Integer
a = Text1.Text
b = Text2.Text
For i = a + 1 To b - 1
For s = 2 To i - 1
If i Mod s = 0 Then GoTo aa:
Next s
Print i
aa:
Next i
End Sub
自己选一个 我不知道你要计算什么
自己在窗体上添加控件之后直接用程序即可
做加法:所有的数做加法
Private Sub Command1_Click()
Dim a As Integer, b As Integer, i As Integer, s As Integer
a = Text1.Text
b = Text2.Text
s = 0
For i = a + 1 To b - 1
s = s + i
Next i
Print s
End Sub
所有的素数的程序为:
Private Sub Command1_Click()
Dim a As Integer, b As Integer, i As Integer, s As Integer
a = Text1.Text
b = Text2.Text
For i = a + 1 To b - 1
For s = 2 To i - 1
If i Mod s = 0 Then GoTo aa:
Next s
Print i
aa:
Next i
End Sub
自己选一个 我不知道你要计算什么
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询