Umiestnenie súboru www.TrSek.com/zadania/sifrovanie_textu.pas{ SIFROVANIE_TEXTU.PAS Copyright (c) Pheo }
{ Program na zakódovanie a dekódovanie textu. Kódovanie je urobené }
{ tak, ¾e ka¾dé písmeno sa nahradí nasledujúcim v abecede. }
{ }
{ Datum:24.04.2003 http://www.trsek.com }
program sifrovanie_textu;
uses crt;
var i,k,n:integer;
a,b :string;
begin
writeln ('zadaj text');
read (a);
writeln ('zvol postup: 0-kodovanie,1-dekodovanie');
read(k);
n:=length(a);
for i:=1 to n do
begin
if k=0 then b[i]:=succ (a[i]);
if k=1 then b[i]:=pred (a[i]);
write (b[i]);
end;
writeln;
repeat until keypressed;
if k=1 then clrscr;
end.