找回密码
 加入
搜索
查看: 3181|回复: 4

[效率算法] 求救写个彩票遗留号码程序

  [复制链接]
发表于 2012-8-19 00:03:55 | 显示全部楼层 |阅读模式
给出的号码是
00 01 03 04 06 07 21 22 24 25
26 27 29 30 31 33 34 35 36 37
39 40 42 43 44 45 46 47 49 51
52 53 54 56 60 61 62 63 64 65
66 67 70 71 72 73 74 76 79 81
82 83 84 89 92 93 94 97 99

需要弄个程序 把0-99这100个号码没有上面这些的号码弄出来 如(02 05 08 09 10 11.......)
弄了半天没有弄出来 求高手帮忙
发表于 2012-8-19 12:37:04 | 显示全部楼层

写个简单的给你玩玩。。
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>

GUICreate("彩票!",600,520,-1,-1)
GUICtrlCreateLabel("要干掉的号:",10,8,100,17)
Local $str='00 01 03 04 06 07 21 22 24 25 26 27 29 30 31 33 34 35 36 37 39 40 42 43 44 45 46 47 49 51 52 53'; 例子
$Edit1=GUICtrlCreateEdit($str,10,30,580,150,0,0)
GUICtrlCreateLabel("剩下的号:",10,195,100,17)
$Edit2=GUICtrlCreateEdit("",10,220,580,150,0,0)
$button1=GUICtrlCreateLabel("干 掉",10,400,100,50,BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetBkColor(-1, 0xA6CAF0)
GUICtrlSetCursor (-1, 0)
GUISetState(@SW_SHOW)

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $button1
                        _fuck()                
        EndSwitch
WEnd                        

Func _fuck()
        Local $i,$j,$k,$cha,$tmparr[1]=['xiaochuan']
        
        ;总数组
        Local $arr_all[10]=['00','01','02','03','04','05','06','07','08','09']
        For $k=10 To 99
                _ArrayAdd($arr_all,$k)
        Next
        
        If GUICtrlRead($Edit1)<>'' Then
                $arr=StringSplit(GUICtrlRead($Edit1),' ');要干掉的数组

                ;要被干掉的每个元素在00-99中的索引,遍历放到一个临时数组中
                For $i=1 To $arr[0]
                        $cha=_ArrayBinarySearch($arr_all,$arr[$i])
                        If $cha<>-1 Then
                                _ArrayAdd($tmparr,$cha)
                        EndIf        
                Next

                ;根据刚才的索引,反向遍历,,,,删
                 For $j=UBound($tmparr)-1 To 1 Step -1
                         _ArrayDelete($arr_all,$tmparr[$j])
                 Next
                
                ;放到第2个文本框
                GUICtrlSetData($Edit2,_ArrayToString($arr_all,' '))
        Else
                MsgBox(0,'提示','木有数据!!')
        EndIf
EndFunc        

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2012-8-19 12:39:59 | 显示全部楼层
厉害 高手  ~
发表于 2012-8-19 12:58:06 | 显示全部楼层
回复 2# xiaochuan
这个可以,_干()函数名字起的不错!
发表于 2012-8-19 13:15:53 | 显示全部楼层
这个可以,_干()函数名字起的不错!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-3 16:58 , Processed in 0.078783 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表