Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
1
const TPolibius: array['A' .. 'E', 'A' .. 'E'] of char = ( ('A', 'B', 'C', 'D', 'E'), ('F', 'G', 'H', 'I', 'K'), ('L', 'M', 'N', 'O', 'P'), ('Q', 'R', 'S', 'T', 'U'), ('V', 'W', 'X', 'Y', 'Z') ); function PolibiusEncipher(toCode: string): string; var i: integer; ix, jx: char; s: string; begin s := ''; for i := 1 to length(toCode) do begin for ix := 'A' to 'E' do for jx := 'A' to 'E' do if TPolibius[ix, jx] = toCode[ i ] then begin s := s + ix + jx; break; end; end; PolibiusEncipher := s end; function PolibiusDecipher(toDecode: string): string; var i: integer; s: string; begin s := ''; i := 1; while i <= length(toDecode) do begin s := s + TPolibius[toDecode[ i ], toDecode[succ(i)]]; inc(i, 2); end; PolibiusDecipher := s end; var s: string; begin s := PolibiusEncipher('MOSCOW KREMLIN'); writeln(s); writeln('s = ', PolibiusDecipher(s)); end.
run
|
edit
|
history
|
help
0
nomer7
2 5 8
formato_real
buscar_numero_V2_divisible_5
test28
07 Ariketa
practica 3 ejercicio 8
nomer5
practica 11 ejercicio 7 BETA
VIGENERECIJFER