diff --git a/.gitignore b/.gitignore index 21d0b89..c136cf9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .venv/ +output.txt \ No newline at end of file diff --git a/data.txt b/data.txt new file mode 100644 index 0000000..220c1eb --- /dev/null +++ b/data.txt @@ -0,0 +1,2 @@ +23 23 5 90 65 67 +45 34 23 6 56 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..de6c89b --- /dev/null +++ b/requirements.txt @@ -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 diff --git a/script.py b/script.py new file mode 100644 index 0000000..8b93cdf --- /dev/null +++ b/script.py @@ -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') +