From cc6b7846146fe3f7f6fbdbc7321d7864717e475f Mon Sep 17 00:00:00 2001 From: Arity-T Date: Tue, 8 Apr 2025 12:17:51 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B3=D0=B0=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BA=D0=BE=D0=BF=D0=B8=D0=BF=D0=B0=D1=81=D1=82=D1=8B?= =?UTF-8?q?=20:0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- decode.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/decode.py b/decode.py index e95b044..1a4001e 100644 --- a/decode.py +++ b/decode.py @@ -6,12 +6,26 @@ def fix_encoding(text): fixed_text = fixed_text.replace("ј", "ё") fixed_text = fixed_text.replace("ѕ", "<<") fixed_text = fixed_text.replace("ї", ">>") + fixed_text = fixed_text.replace("\x16", "--") + fixed_text = fixed_text.replace("\x10", "<<") + fixed_text = fixed_text.replace("\x11", ">>") return fixed_text if __name__ == "__main__": while True: - corrupted_text = input("Введите искажённый текст: ") + print("Введите искажённый текст и нажмите enter:") + + text_lines = [] + while True: + line = input() + if line == "": + # Если строка пустая, это означает, что пользователь сделал + # двойной перенос строки. + break + text_lines.append(line) + + corrupted_text = "\n".join(text_lines) print() print(fix_encoding(corrupted_text))