本帖最后由 大绯狼 于 2010-4-10 12:52 编辑 #include <Array.au3>
Dim $Rnum[10]
For $i = 0 To 9
$Rnum[$i] =Random(0,100,1)
Next
_ArraySort($Rnum);排序我就不排了
_ArrayDisplay($Rnum)
$ins = Random(0,100,1)
If $ins > $Rnum[UBound($Rnum) - 1] Then
ReDim $Rnum[UBound($Rnum) + 1]
$Rnum[UBound($Rnum) - 1] = $ins
Else
For $i = 0 To 9
If $Rnum[$i] > $ins Then
ReDim $Rnum[UBound($Rnum) + 1]
For $j = UBound($Rnum) To $i + 1 Step - 1
If $j = 1 Then ExitLoop
$Rnum[$j - 1] = $Rnum[$j - 2]
Next
$Rnum[$i] = $ins
ExitLoop
EndIf
Next
EndIf
_ArrayDisplay($Rnum)
|