djfz-2019-s426197/TaskX04/run.py
2019-11-05 15:03:27 +01:00

20 lines
379 B
Python

import sys
import re
commentPattern = re.compile('^#.*')
automataStepPattern = re.compile(r'[0-9]+ [0-9]+ [A-Za-z]+( ([0-9]+\.[0-9]+)|)')
#print("First argument: ", sys.argv[0])
steps = 0
for line in sys.stdin:
line = line.replace('\n', '')
if commentPattern.match(line):
continue
if automataStepPattern.match(line):
steps += 1
print(steps)