https://www.hackerrank.com/challenges/text-processing-cut-1/problem
我的解答:
while read line
do
echo ${line:2:1}
done
错误测试样例:
Input
C.B - Cantonment Board/Cantonment
C.M.C – City Municipal Council
C.T – Census Town
E.O – Estate Office
G.P - Gram Panchayat
I.N.A – Industrial Notified Area
I.T.S - Industrial Township
M – Municipality
M.B – Municipal Board
M.C – Municipal Committee
my output
B
M
T
O
P
N
T
–
B
expect output
B
M
T
O
P
N
T
B
C
不仅少算了一行,而且第8个的输出也不对。