djfz-2020-s444507/TaskA03/run.py

24 lines
450 B
Python
Raw Normal View History

2020-11-08 11:55:46 +01:00
import sys
def is_date_in_line(line):
2020-11-08 13:46:04 +01:00
2020-11-08 12:40:17 +01:00
index = 0
2020-11-08 13:46:04 +01:00
2020-11-08 12:40:17 +01:00
while index != -1:
index = line.find(' r.', index+1)
if index == -1:
2020-11-08 11:55:46 +01:00
return False
2020-11-08 12:40:17 +01:00
if line[index - 4] == '1' and line[index - 3] == '9':
year = int(line[index - 4:index])
if 1999 >= year >= 1900:
return True
return False
2020-11-08 11:55:46 +01:00
for line in sys.stdin:
if is_date_in_line(line):
print(line.rstrip('\n'))