求解第二题第二题第二题
3个回答
展开全部
用到随机数。
百度一下你就知道了!!!
百度一下你就知道了!!!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
做好了怎么发给你?
第一题
Private Sub Command1_Click()
Dim m, n, r, t As Integer
m = Val(Text1.Text)
n = Val(Text2.Text)
If m < n Then t = m: m = n: n = t
r = m Mod n
Do While (r <> 0)
m = n
n = r
r = m Mod n
Loop
Text3.Text = n
End Sub
第三题
Private Sub Command1_Click()
Dim n As Integer
n = Val(Text1.Text)
For i = 1 To n
Print Space(n + 10 - i); String(2 * i - 1, "*")
Next i
End Sub
第二题
Private Sub Command1_Click()
Dim a(10) As Integer
Dim s As String
s = ""
For i = 1 To 10
a(i) = Int(Rnd * 100) + 100
s = s & a(i) & " "
Next i
Print s;
For i = 1 To 10
For j = 1 To 10 - i
If a(j) > a(j + 1) Then
temp = a(j + 1)
a(j + 1) = a(j)
a(j) = temp
End If
Next j
Next i
Print
s = ""
For i = 1 To 10
s = s & a(i) & " "
Next i
Print s
End Sub
第一题
Private Sub Command1_Click()
Dim m, n, r, t As Integer
m = Val(Text1.Text)
n = Val(Text2.Text)
If m < n Then t = m: m = n: n = t
r = m Mod n
Do While (r <> 0)
m = n
n = r
r = m Mod n
Loop
Text3.Text = n
End Sub
第三题
Private Sub Command1_Click()
Dim n As Integer
n = Val(Text1.Text)
For i = 1 To n
Print Space(n + 10 - i); String(2 * i - 1, "*")
Next i
End Sub
第二题
Private Sub Command1_Click()
Dim a(10) As Integer
Dim s As String
s = ""
For i = 1 To 10
a(i) = Int(Rnd * 100) + 100
s = s & a(i) & " "
Next i
Print s;
For i = 1 To 10
For j = 1 To 10 - i
If a(j) > a(j + 1) Then
temp = a(j + 1)
a(j + 1) = a(j)
a(j) = temp
End If
Next j
Next i
s = ""
For i = 1 To 10
s = s & a(i) & " "
Next i
Print s
End Sub
更多追问追答
追问
图
图拍给我吧
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐于2016-01-04
展开全部
Private Sub Form_Load()
Dim A(1 To 10) As Integer, MM As Integer
For I = 1 To 10
Randomize
A(I) = Int(Rnd * 100 + 100)
Text1.Text = Text1.Text & A(I) & " "
Next I
For I = 1 To 9
For J = I + 1 To 10
If A(I) > A(J) Then
MM = A(I)
A(I) = A(J)
A(J) = MM
End If
Next J
Next I
For I = 1 To 10
Text2.Text = Text2.Text & A(I) & " "
Next I
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询