Begin TaskA04

This commit is contained in:
s473573 2024-11-01 13:57:56 +01:00
parent cd74f9ca4c
commit 58e8d6c4ad
2 changed files with 19965 additions and 0 deletions

File diff suppressed because it is too large Load Diff

25
TaskA04/solution.py Normal file
View File

@ -0,0 +1,25 @@
import sys
def solve(lines):
res = []
for l in lines:
numbers = []
for w in l.split():
number = ''.join(filter(lambda c: c.isdigit(), w))
if number:
numbers.append(number)
if numbers:
res.append(' '.join(numbers) + '\n')
return res
if __name__ == "__main__":
lines = []
fp = sys.argv[1]
with open("../TaskA02/polish_wiki_excerpt.in", encoding="utf-8") as f:
lines = f.readlines()
sol = solve(lines)
with open("./polish_wiki_excerpt.out", 'w', encoding="utf-8") as f:
f.writelines(sol)