SAY討論區

標題: How can we use ascending order for this? [打印本頁]

作者: frankyhui    時間: 2012-5-12 02:25:41     標題: How can we use ascending order for this?

<div class="blockcode"><span class="headactions" onclick="copycode($('code0'));">複製內容到剪貼板</span><h5>代碼:</h5><code id="code0">Public Class Form1

  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  Dim number As Integer
  Dim n As Integer
  Dim M6(49) As Integer
  Dim repeated As Boolean

  For x = 0 To 5
    Do
      repeated = False
      number = 49 * Rnd()

      For intindex = 0 To 5
      If number = intarray(n) Then
        repeated = True
      End If
      Next
    Loop Until repeated = False

    intarray(x) = number

  Next

  TextBox1.Text = M6(0)
  TextBox2.Text = M6(1)
  TextBox3.Text = M6(2)
  TextBox4.Text = M6(3)
  TextBox5.Text = M6(4)
  TextBox6.Text = M6(5)
  End Sub

End Class</code>




歡迎光臨 SAY討論區 (http://say.go2tutor.com/) Powered by Discuz! X2