回複:Perl programming question

來源: 飛楊 2010-05-16 02:55:08 [] [博客] [舊帖] [給我悄悄話] 本文已被閱讀: 次 (688 bytes)
If I understand your problem correctly, here is the solution:

use strict;
my ($A,$B,$C)=([1,2,4],[1,2,2],[1,2,3]);
my @outer=($A,$B,$C);
my @sorted=sort { $a->[0] <=> $b->[0] ||
                  $a->[1] <=> $b->[1] ||
                  $a->[2] <=> $b->[2] } @outer;
map { print "@$_\\n"; } @sorted;
HTH
請您先登陸,再發跟帖!

發現Adblock插件

如要繼續瀏覽
請支持本站 請務必在本站關閉/移除任何Adblock

關閉Adblock後 請點擊

請參考如何關閉Adblock/Adblock plus

安裝Adblock plus用戶請點擊瀏覽器圖標
選擇“Disable on www.wenxuecity.com”

安裝Adblock用戶請點擊圖標
選擇“don't run on pages on this domain”