Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
35
Task/Rot-13/Pascal/rot-13.pas
Normal file
35
Task/Rot-13/Pascal/rot-13.pas
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
program rot13;
|
||||
|
||||
var
|
||||
line: string;
|
||||
|
||||
function rot13(someText: string): string;
|
||||
|
||||
var
|
||||
i: integer;
|
||||
ch: char;
|
||||
result: string;
|
||||
|
||||
begin
|
||||
result := '';
|
||||
for i := 1 to Length(someText) do
|
||||
begin
|
||||
ch := someText[i];
|
||||
case ch of
|
||||
'A' .. 'M', 'a' .. 'm':
|
||||
ch := chr(ord(ch)+13);
|
||||
'N' .. 'Z', 'n' .. 'z':
|
||||
ch := chr(ord(ch)-13);
|
||||
end;
|
||||
result := result + ch;
|
||||
end;
|
||||
rot13 := result;
|
||||
end;
|
||||
|
||||
begin
|
||||
while not eof(input) do
|
||||
begin
|
||||
readln(line);
|
||||
writeln(rot13(line));
|
||||
end;
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue