perl 统计百分比,怎么写代码有一个表格,第一列为名称,第二列为数值,统计一下 第二列中0.1出现的百分率.NAMESIGNALA10.1A22A30.1A42A50.1A62A70.1A82A90.1A102A110.1A122A130.1A142A150.1A162A170.1A182A19
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/19 16:01:02
perl统计百分比,怎么写代码有一个表格,第一列为名称,第二列为数值,统计一下第二列中0.1出现的百分率.NAMESIGNALA10.1A22A30.1A42A50.1A62A70.1
perl 统计百分比,怎么写代码有一个表格,第一列为名称,第二列为数值,统计一下 第二列中0.1出现的百分率.NAMESIGNALA10.1A22A30.1A42A50.1A62A70.1A82A90.1A102A110.1A122A130.1A142A150.1A162A170.1A182A19
perl 统计百分比,怎么写代码
有一个表格,第一列为名称,第二列为数值,统计一下 第二列中0.1出现的百分率.
NAMESIGNAL
A10.1
A22
A30.1
A42
A50.1
A62
A70.1
A82
A90.1
A102
A110.1
A122
A130.1
A142
A150.1
A162
A170.1
A182
A190.1
A202
A210.1
A222
perl 统计百分比,怎么写代码有一个表格,第一列为名称,第二列为数值,统计一下 第二列中0.1出现的百分率.NAMESIGNALA10.1A22A30.1A42A50.1A62A70.1A82A90.1A102A110.1A122A130.1A142A150.1A162A170.1A182A19
open F1,"1.txt" or die $!;
@array=<F1>;
foreach(@array){if(/^A/){$count++; ($s1,$s2)=split/\s+/,$_;if($s2==0.1){$t++;}}}
$p=$t/$count;
print "$p\n";