Zadanie D00

This commit is contained in:
s450026 2020-12-06 23:12:41 +01:00
parent 34d8bb9667
commit 6213fa8193
4 changed files with 31 additions and 1 deletions

28
TaskD00/D00.py Normal file
View File

@ -0,0 +1,28 @@
import re
import sys
def substitute_numbers(string):
result = ''
subs = {
'0': 'a',
'1': 'b',
'2': 'c',
'3': 'd',
'4': 'e',
'5': 'f',
'6': 'g',
'7': 'h',
'8': 'i',
'9': 'j'
}
for char in string:
result += subs[char]
return result
regex = r"[0-9]{4}"
for line in sys.stdin:
line = re.sub(regex, lambda m: substitute_numbers(m.group()), line)
print(line.rstrip('\n'))

0
TaskD00/Makefile Normal file
View File

2
TaskD00/run Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
python3 TaskD00/D00.py "$@"

View File

@ -1,2 +1,2 @@
POINTS POINTS
13 25

1 POINTS
2 13 25