Sat Nov 22, 2008 12:33 am
program shfrovalka;
uses crt;
var text:string;
m,k,c,men:integer;
procedure cez(var text:string; var k:integer);
begin
clrscr;
writeln('vvedite isxodniy text ');
write('$~/> ');
read(text);
write('vvedite klu4 shifrovani9 ');
readln(k);
for m:=1 to length(text) do
begin
c:=ord(text[m])+k;
if c>256 then c:=c-256;
text[m]:=chr(c);
end;
end;
procedure desh (var text:string);
begin
writeln('vvedite kluch deshifrovki' );
readln(k);
for m:=1 to length(text) do
begin
c:=ord(text[m])-k;
if c<256 then c:=c+256;
text[m]:=chr(c);
end;
end;
begin
repeat
clrscr;
writeln('1 - shifrovka ');
writeln('2 - deshifrovka ');
writeln('3 - sosto9nie texta ');
readln(men);
case men of
1:cez(text,k);
2:desh(text); U?
3:begin
writeln(text);
readkey;
end;
end;
until men = 0;
end.
Wed Nov 26, 2008 1:24 am
http://www.garret.ru/ptoc/Readme.htm
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.