Добавлены файлы data.txt, script.py

This commit is contained in:
Виктор Пичугин 2025-03-06 17:17:55 +03:00
parent f358e5d2a8
commit 10c3374059
4 changed files with 20 additions and 0 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
.venv/ .venv/
output.txt

2
data.txt Normal file
View File

@ -0,0 +1,2 @@
23 23 5 90 65 67
45 34 23 6 56

6
requirements.txt Normal file
View File

@ -0,0 +1,6 @@
numpy==2.2.3
pandas==2.2.3
python-dateutil==2.9.0.post0
pytz==2025.1
six==1.17.0
tzdata==2025.1

11
script.py Normal file
View File

@ -0,0 +1,11 @@
with open('data.txt','r') as file:
lines = file.readlines()
sorted_lines = []
for line in lines:
sorted_line=' '.join(sorted(line.split(), key=int))
sorted_lines.append(sorted_line)
with open('output.txt', 'w') as file:
for sorted_line in sorted_lines:
file.write(sorted_line + '\n')