okbeng 2008-07-16 04:41:00
点我顶贴
收藏
删除
为什么用字符串作老是超时?
主程序如下:
begin
readln(p1,p2,p3);
readln(sm);
repeat
p:=pos(-,sm);
if p=0 then break;
if p=1 then continue;
if (sm[p-1]>=sm[p+1]) or ((sm[p-1] <=9) and (sm[p+1] >=a)) or ((sm[p-1] >=a) and (sm[p+1] <=9))
then sm[p]:=+ else
ex(p);
until p=0;
repeat
p:=pos(+,sm);
if p>0 then sm[p]:=-;
until p=0;
writeln(sm);
end.