Ответы на вопрос:
< ! doctype html> < html> < head> < style> body { text-align: center; } form { display: inline-block; width: 40%; } label { display: block; } textarea { width: 100%; height: 300px; } button { width: 45%; } < /style> < script> function deshifr() { let text = document.getelementbyid("shifr").value; let l = text.length; let nechet = text.substr(0,l/2+l%2); let chet = text.substr(l/2+l%2,l/2); let deshifr = ""; for (let i = 0, c = 0, n = 0; i < l; i++) { deshifr += (i%2? chet[c++]: nechet[n++]); } document.getelementbyid("deshifr").innerhtml = deshifr; } < /script> < /head> < body> < form> < label for="shifr"> введите зашифрованный тест сообщения: < /label> < textarea id="shifr"> < /textarea> < button type="button" onclick="deshifr()"> расшифровать< /button> < div id="deshifr"> < /div> < /form> < /body> < /html>
Популярно: Информатика
-
yuyornevzkoxkdhd54311.07.2021 17:21
-
машана114.03.2023 16:11
-
podsypa01.08.2021 07:51
-
Anchoys77719.07.2022 00:14
-
lisopat10.03.2020 11:23
-
UNCLEVLAD05.05.2020 20:24
-
Конник95301.10.2021 14:56
-
таисия8507.08.2021 18:50
-
sashasasha40402.03.2023 02:31
-
Fire4ik112.03.2023 01:28