Created
May 11, 2022 08:59
-
-
Save washingtonsoares/9a7c1d70ee6e2b68bbe4dfc3f7af80f1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.beecrowd.com.br/judge/pt/problems/view/1024 | |
n = int(input()) | |
for _ in range(n): | |
text = input() | |
text2 = "" | |
# first step | |
for char in text: | |
if (char.isalpha()): | |
text2 += chr(ord(char) + 3) | |
else: | |
text2 += char | |
# second step | |
text3 = text2[::-1] | |
# third step | |
text4 = "" | |
first_half = text3[:len(text3)//2] | |
second_half = text3[len(text3)//2:] | |
for char in second_half: | |
text4 += chr(ord(char) - 1) | |
print(first_half, end='') | |
print(text4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment