首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

perl 数组,该如何解决

2012-02-17 
perl 数组my @set (#input, #output[ 2,2,3,4,1 ], [ 1,1,1,1,1 ],[ 1,1,1,1,1 ], [ 0,0,0,0,0 ],[ 1,1,

perl 数组
my @set = (
  #input , #output
  [ 2,2,3,4,1 ], [ 1,1,1,1,1 ],
  [ 1,1,1,1,1 ], [ 0,0,0,0,0 ],
  [ 1,1,1,0,0 ], [ 0,0,0,1,1 ]  
  );


perl 数组,如果我要动态加的话我可以这样吗

my @set;
push(@set,[ 2,2,3,4,1 ]);
push(@set,[ 1,1,1,1,1 ]);
push(@set,[ 1,1,1,1,1 ]);
push(@set,[ 0,0,0,0,0 ]);
push(@set,[1,1,1,0,0]);
push(@set,[0,0,0,1,1]);
或者可以这样吗




[解决办法]
可以,没有问题
祝新年快乐

热点排行