This commit is contained in:
deadsmond 2019-12-03 13:17:44 +01:00
parent 5d6b14838c
commit 5e2b0ebca6
1 changed files with 2 additions and 11 deletions

View File

@ -1,17 +1,8 @@
#!/usr/bin/python3 #!/usr/bin/python3
import sys import sys
import re import re
count = 0 count = 0
def is_number(test):
pattern = re.compile(r'[0-9] [0-9]+ [a-z](\s\d+.\d+){0,1}')
result = re.match(pattern, test[:-1])
if result:
count += 1
for line in sys.stdin: for line in sys.stdin:
is_number(line) if re.search("^\d+\s\d+\s[a-z](\s\d+\.\d+){0,1}$", line):
count+=1
print(count) print(count)