Zadanie D00
This commit is contained in:
parent
34d8bb9667
commit
6213fa8193
28
TaskD00/D00.py
Normal file
28
TaskD00/D00.py
Normal 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
0
TaskD00/Makefile
Normal file
2
TaskD00/run
Executable file
2
TaskD00/run
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
python3 TaskD00/D00.py "$@"
|
@ -1,2 +1,2 @@
|
||||
POINTS
|
||||
13
|
||||
25
|
||||
|
|
Loading…
Reference in New Issue
Block a user