看板
[ CSSE ]
討論串[問題] 未排序的陣列,演算法相關問題
共 13 篇文章
內容預覽:
: @Hoy(@y)=(); # 只要鍵不用值. : for (@x) { print "exists" and last if exists $Hoy{$num-$_}; }. :. : 這樣的話只會印出 "exists" 一次就會跳出迴圈了XD. 坦白說… Perl code 我只會寫不會讀…X
(還有559個字)
內容預覽:
# form y hash of array. # key -> value of y array. # value -> array of y indexes which point to the associative value. $idx = 0;. for $item (@y) {. pu
(還有682個字)
內容預覽:
這行看不懂. 我是對@x做迴圈. foreach $item (@x). 可讀作 for each $item in @x array. hash 中沒有格不格的問題啊@ @. $yhash{$num-$item}. 是把$num-$item的值. 丟進" if exists $yhash " 中.
(還有225個字)