2041_21T1.Q2

q1的python-stdin实现

用startswith来匹配

1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env python3

import sys

count = 0

for line in sys.stdin:
field = line.strip().split("|")

if len(field) >=2 and field[-2].startswith("3711/"):
count += 1

print(count)