题解 | #求平均值#

求平均值

https://www.nowcoder.com/practice/c44b98aeaf9942d3a61548bff306a7de

#!/bin/bash
echo "scale=3;`cat nowcoder.txt | awk 'BEGIN{getline;sum=0;}{sum+=$1;}END{print sum}'` / $[`wc -l nowcoder.txt | awk '{print $1}'` - 1]" | bc

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务