PASCAL 简单程序!!!

P1914 小书童——凯撒密码

EK_KING_ @ 2017-08-30 15:18:00

var
i,k,n:longint;
s:string;
begin
readln(k);
readln(s);
n:=length(s);
for i:=1 to n do
begin
s[i]:=chr(ord(s[i])+k);
if ord(s[i])>122 then s[i]:=chr(ord(s[i])-26);
end;
write(s);
end.

by DawnLannister @ 2017-09-20 20:26:45

var s:ansistring;i,n:longint;
begin
    readln(n);readln(s);
    for i:=1 to length(s) do begin s[i]:=chr((ord(s[i])-96+n)mod 26 +96);if s[i]='`' then s[i]:='z';end;
    writeln(s);
end.
确实好简单,,,,,

|