ac1096.pas
来自「这是在网络上搜集到的在东京大学的ACM上面解决的一些题目的源码」· PAS 代码 · 共 23 行
PAS
23 行
program tju1096;
var
s:ansistring;
function code(s:ansistring):ansistring;
var
l:word;
a,b:ansistring;
begin
l:=length(s) shr 1;
if l=0 then
if s='0' then code:='A' else code:='B'
else begin
a:=code(copy(s,1,l));b:=code(copy(s,l+1,l));
if (a[1]=b[1]) and (a[1] in ['A','B']) then code:=a else code:='C'+a+b;
end;
end;
begin
repeat
readln(s);
writeln(code(s));
until seekeof;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?