求大神帮忙VB答案1.下列程序功能:在窗体的3个文本框(Text1、Text2、Text3)中输入三个数,将它们从大到小
求大神帮忙VB答案
1.下列程序功能:在窗体的3个文本框(Text1、Text2、Text3)中输入三个数,将它们从大到小排序,并在文本框(Text4)中输出排序结果。请填写程序空白处使程序完整。
Private Sub Command1_Click()
a = Val(Text1.Text)
b = (1)
c = Val(Text3.Text)
If a < b Then
(2)
End If
If a <= c Then
t = a: a = c: c = t
(3)
If b <= c Then
t = b: b = c: c = t
End If
(4) = a & "," & b & "," & c
End Sub
2.下列程序功能:将数值序列3,6,9,12,…,99存入数组中,并显示在窗体上(要求每一行上输出3个)。请填写程序空白处使程序完整。
Option Base 1
Dim m(33) As Integer
Private Sub Command1_Click()
Dim n As Integer
m(1) = 3
n = 0
For i = 1 To 33
m( i ) = (5)
If (6) Then
Print
n = 0
End If
n = n + 1
Print "M(" & i & ")=" & m(i),
(7)
End Sub
2.下列程序功能:将数值序列3,6,9,12,…,99存入数组中,并显示在窗体上(要求每一行上输出3个)。请填写程序空白处使程序完整。
Option Base 1
Dim m(33) As Integer
Private Sub Command1_Click()
Dim n As Integer
m(1) = 3
n = 0
For i = 1 To 33
m( i ) = (5)
If (6) Then
Print
n = 0
End If
n = n + 1
Print "M(" & i & ")=" & m(i),
(7)
End Sub