本帖最后由 easefull 于 2011-5-5 15:50 编辑
假设有栋8层高的楼.每层楼有8个房间,房间编号为01-08.
$Array[0] = 楼高
$Array[0]-[10] = 数组镶嵌,表示每层楼的房间号列表.
#include <Array.au3>
Local $aRoom[8]
Local $aMode[8] = ["01","02","03","04","05","06","07","08"]
Local $iCount = 8
Local $Array[$iCount+1]
$Array[0] = $iCount
For $i = 1 To 8 Step 1
For $k = 0 To 7 Step 1
$aRoom[$k] = $i & $aMode[$k]
Next
;~ _ArrayDisplay($aRoom)
$Array[$i] = $aRoom ;数组镶嵌
Next
$sQuestion = '我现在想取出第6层楼,第6个房间的房间编号,如果不用下面的方法' &@CRLF& _
@TAB & '$aTmp = $Array[6]' &@CRLF& _
@TAB & 'MsgBox(4096, "6楼第6个房间", $aTmp[5])' &@CRLF& _
@CRLF& '代码应该要怎么写?'
MsgBox(4096, "数组镶嵌的使用问题", $sQuestion)
Exit
|