jfz-2023-s474155/TaskE01/run.py

19 lines
516 B
Python

import re
import sys
def is_divisible_by_25(s):
pattern = re.compile(r'(^[1-9][0-9]*(00$|25$|50$|75$))|(^25$|^50$|^75$)')
return bool(re.match(pattern, s))
inFile = sys.argv[1]
outFile = sys.argv[2]
# inFile = 'test.in'
# outFile = 'test.out'
with open(inFile, 'r', encoding='utf-8') as inputFile, open(outFile, 'w', encoding='utf-8') as outputFile:
for line in inputFile:
line = line.strip()
result = "yes" if is_divisible_by_25(line) else "no"
outputFile.write(result+'\n')