From 039cfad400bc7c178e3bb3eb4306fe074b358d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B0=D0=BD=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D0=B0=D0=B2=D0=B8=D0=BD=D1=8B=D1=85?= Date: Thu, 6 Mar 2025 23:28:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20data.txt,=20scr?= =?UTF-8?q?ipt.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- data.txt | 12 ++++++++++++ script.py | 10 ++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 data.txt create mode 100644 script.py diff --git a/.gitignore b/.gitignore index 0cafc1c..c136cf9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.venv/ \ No newline at end of file +.venv/ +output.txt \ No newline at end of file diff --git a/data.txt b/data.txt new file mode 100644 index 0000000..4b9a7c3 --- /dev/null +++ b/data.txt @@ -0,0 +1,12 @@ +13 +8 +11 +25 +1005 +581 +42 +66 +81 +9 +1 +852 \ No newline at end of file diff --git a/script.py b/script.py new file mode 100644 index 0000000..b977872 --- /dev/null +++ b/script.py @@ -0,0 +1,10 @@ +with open('data.txt', 'r') as file: + lines = file.readlines() + +numbers = [int(line.strip()) for line in lines] + +sorted_numbers = sorted(numbers, reverse=True) + +with open('output.txt', 'w') as output_file: + for number in sorted_numbers: + output_file.write(f"{number}\n") \ No newline at end of file