题解 | #求平均值#
求平均值
http://www.nowcoder.com/practice/c44b98aeaf9942d3a61548bff306a7de
shell awk代码
awk '
NF < 0
{
if (NR > 1)
s += $1
}
END {printf "%.3f\n", s / (NR - 1)}
'
求平均值
http://www.nowcoder.com/practice/c44b98aeaf9942d3a61548bff306a7de
shell awk代码
awk '
NF < 0
{
if (NR > 1)
s += $1
}
END {printf "%.3f\n", s / (NR - 1)}
'
相关推荐