OlveraeUNSW
返回题目列表
COMP2041

22T2 Q8 — Hottest 100 过滤

stdin 为 poll|position|artist|track 行。删掉首行和末行。其余行中,poll 非 4 位年份或 position 非 1..10 整数的丢弃。保留的行输出 track - artist。


POSIX shell only (#!/bin/dash); standard UNIX filters. From COMP2041/9044 22T2 Final.

样例

stdin
=== HEADER ===
2009|1|Artist A|Song A
99|2|Bad Year|Song B
2010|11|Artist C|Song C
2011|3|Artist D|Song D
=== FOOTER ===
期望输出
Song A - Artist A
Song D - Artist D
shell
14