@ 2018-01-26T15:43:42Z <?php
function decode(string $phrase): string
{
$dictionary = [
1 => 'а',
2 => 'е',
3 => 'ё',
4 => 'и',
5 => 'й',
6 => 'о',
7 => 'у',
8 => 'э',
9 => 'ю',
10 => 'я',
11 => 'б',
12 => 'в',
13 => 'г',
14 => 'д',
15 => 'ж',
16 => 'з',
17 => 'к',
18 => 'л',
19 => 'м',
20 => 'н',
21 => 'п',
22 => 'р',
23 => 'с',
24 => 'т',
25 => 'ф',
26 => 'х',
27 => 'ц',
28 => 'ч',
29 => 'ш',
30 => 'щ',
31 => 'ь',
32 => 'ы',
33 => 'ъ',
];
$words = explode(' ', $phrase);
$result = '';
foreach ($words as $word) {
$letters = explode('.', $word);
$result .= ' ' . implode('', array_map(function ($value) use ($dictionary) {
$index = (int) $value;
if ($index < 1 || $index > 33) {
return $value;
}
return $dictionary[(int)$value];
}, $letters));
}
return $result;
}
echo decode('6.19.4 6.23.7.15.14.1.9.24 19.2.20.10 21.22.2.15.12.3 , 28.2.19 7.16.20.1.9.24.');
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.1.0 - 7.1.20 , 7.2.0 - 7.2.33 , 7.3.16 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.4 , 8.3.6 оми осуждают меня прежвё , чем узнают Output for 8.3.5 Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
оми осуждают меня прежвё , чем узнают preferences:dark mode live preview
143.6 ms | 402 KiB | 158 Q