vb对随机数组筛选并排序
单击按钮,在text1.text中会随机出现十个数(这是已知条件),请问怎么编写程序,让其中能被3整除的在text2.text中从小到大排列出来?...
单击按钮,在text1.text中会随机出现十个数(这是已知条件),请问怎么编写程序,让其中能被3整除的在text2.text中从小到大排列出来?
展开
3个回答
展开全部
Dim str As String
Dim pout As String
pout = ""
Dim n As Integer
n = 0
str = text1.text
Dim l As Integer
l = Len(str)
Dim a() As String
a = Split(str, " ")
Dim b() As Integer
For i = 1 To UBound(a)
b(i) = Val(a(i))
If b(i) Mod 3 = 0 Then
pout = pout & b(i)
End If
Next
text2.text = pout
2015-05-27
展开全部
双胎妊娠不一定都需要剖腹产,有的也可以顺产的。根据您提供的数据胎儿体重基本达到了平均值,胎盘成熟度儿级也符合生产的要求,羊水指数也在正常范围内。暗区透声稍差说明羊水有点浑浊,在胎儿不缺氧的情况下可以继续妊娠,建议继续观察达到38–39周后再选择是否剖腹产
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command1_Click()
Dim a(10) As Integer
b = Split(Trim(Text1.Text), " ")
total = 0
For i = 0 To UBound(b)
If Val(b(i)) Mod 3 = 0 Then
total = total + 1
a(total) = Val(b(i))
End If
Next i
For i = 1 To total - 1
For j = i + 1 To total
If a(i) > a(j) Then
k = a(i): a(i) = a(j): a(j) = k
End If
Next j, i
Text2.Text = ""
For i = 1 To total
Text2.Text = Text2.Text & a(i) & " "
Next i
End Sub
Private Sub Form_Load()
Text1.Text = ""
For i = 1 To 10
x = Int(10 + Rnd * 90)
Text1.Text = Text1.Text & x & " "
Next i
End Sub
Dim a(10) As Integer
b = Split(Trim(Text1.Text), " ")
total = 0
For i = 0 To UBound(b)
If Val(b(i)) Mod 3 = 0 Then
total = total + 1
a(total) = Val(b(i))
End If
Next i
For i = 1 To total - 1
For j = i + 1 To total
If a(i) > a(j) Then
k = a(i): a(i) = a(j): a(j) = k
End If
Next j, i
Text2.Text = ""
For i = 1 To total
Text2.Text = Text2.Text & a(i) & " "
Next i
End Sub
Private Sub Form_Load()
Text1.Text = ""
For i = 1 To 10
x = Int(10 + Rnd * 90)
Text1.Text = Text1.Text & x & " "
Next i
End Sub
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询