题解 | #求平均值#
求平均值
https://www.nowcoder.com/practice/c44b98aeaf9942d3a61548bff306a7de
#!/bin/bash awk '{ if(NR==1){n=$0;}else{sum+=$0;} if(NR==n+1){printf("%.3f",sum/n);} }'
求平均值
https://www.nowcoder.com/practice/c44b98aeaf9942d3a61548bff306a7de
#!/bin/bash awk '{ if(NR==1){n=$0;}else{sum+=$0;} if(NR==n+1){printf("%.3f",sum/n);} }'
相关推荐