Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/awk -f
- BEGIN {
- field[4] = "英語"
- field[5] = "数学"
- field[6] = "国語"
- field[7] = "理科"
- field[8] = "社会"
- for (i in field) {
- sum[i] = 0
- max[i] = 0
- min[i] = 100
- }
- }
- {
- nr++;
- for (i in field) {
- sum[i] += $i
- if (max[i] < $i) { max[i] = $i }
- if (min[i] > $i) { min[i] = $i }
- }
- }
- END {
- for (i in field) {
- print field[i], sum[i] / nr, max[i], min[i]
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement