perl删除重复元素
#!/usr/bin/perlusewarnings;usestrict;my(@protein,%count,$protein,$d);chomp(@protein=<...
#!/usr/bin/perl
use warnings;
use strict;
my(@protein,%count,$protein,$d);
chomp(@protein=<STDIN>);
foreach $protein(@protein) {
$count{$protein}+=1;
}
foreach $protein (keys %count) {
while($count{$protein}==1){
$d=$protein;
}
}
print $d;
大神们帮忙看看这个程序哪里不对啊 展开
use warnings;
use strict;
my(@protein,%count,$protein,$d);
chomp(@protein=<STDIN>);
foreach $protein(@protein) {
$count{$protein}+=1;
}
foreach $protein (keys %count) {
while($count{$protein}==1){
$d=$protein;
}
}
print $d;
大神们帮忙看看这个程序哪里不对啊 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询