Ответ учителя по предмету Информатика
Введите смещение: 1
Делу время — потехе час | Еёмф гсёна — рпуёцё шбт
С Новым годом | Т Опгьн дпепн
Первое сентября | Рёсгпё тёоуавса
Исходный код на Python3:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
TL2I = dict(zip(«АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ»,range(34)))
I2TL = dict(zip(range(34),»АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ»))
SL2I = dict(zip(«абвгдеёжзийклмнопрстуфхцчшщъыьэюя»,range(34)))
I2SL = dict(zip(range(34),»абвгдеёжзийклмнопрстуфхцчшщъыьэюя»))
phrases = (‘Делу время — потехе час’, ‘С Новым годом’, ‘Первое сентября’)
key = int(input(«Введите смещение: «))
for phrase in phrases:
ciphered = »
for c in phrase:
if not c.isalpha():
ciphered += c
if c.islower():
ciphered += I2SL[ (SL2I[c] + key) % 33 ]
if c.isupper():
ciphered += I2TL[ (TL2I[c] + key) % 33 ]
print(«{} | {}».format(phrase, ciphered))
Похожие вопросы от пользователей
1. Last year Nick (is/was) thirteen. How old (is/was) he now?
2. Last January we (go/went) to Scotland by train, we often (go/went) there by train.
3. Joan’s brother (is going to visit/visited) Paris soon.
4. What wonderful weather we (are having/have) today!
5. Jane always (takes/ is going to take) a train to Glasgow.
6. We (decide/decided) to go to Russia in June.
7. Bess (does/did) her room two hour ago. She always (does/did) her room on Saturday.
8. How often (did/do) you (write/wrote) letters to your granny last spring?
9. Do you know where the London Museum (was/is)?
10. Boris sometimes (has/had) a lot of friends in his country house.
11. Little Peter (ran/run) to his granny and she (gave/is giving) him an apple.
12. Polly (eat/ate) a cucumber sandwich and (drink/drank) some strong tea.
13. Yesterday at the bus-stop I (meet/met) my friend Aleck.
14. I didn’t (see/saw) Fred at the party. (Was/Is) he there?