世人皆醒我独醉perlmason.blog.chinaunix.net
mouse.rice
系统运维
全部博文(19)
2013年(6)
2011年(2)
2009年(4)
2008年(7)
haoxing1
26702009
心随行
y6cmE
skyyy90
majormy
perlmaso
filippo3
david_95
分类:
2009-03-10 22:14:42
#文管打印机纸张统计-简单的模拟一个小问题。my %hash;while (<DATA>) { my ($id,$type,$num) = (split)[0,1,2]; if (exists $hash{"$id\t$type"}) { $hash{"$id\t$type"} += $num; } else { $hash{"$id\t$type"} = $num; }}foreach my $k(sort keys %hash) { print "$k\t",$hash{$k},"\n";}__END__001 A4 2002 A3 3002 A4 6004 A4 1004 A4 5
上一篇:修改CISCO交换机密码—GUI图形工具【Perl TK编写】
下一篇:perl处理公司电话费用报表【电信数据】
登录 注册