非常简单的模拟: { Author:wzx961008 Problem:UVa 445-Marvelous Mazes Verdict:Accepted Language:PASCAL Run Time:0.004s Submission Date:2011-01-15 01:40:14 } var s:string; t,i,j:longint; begin while not eof do begin readln(s); i:=0; if s='' then begin writeln; continue; end; repeat inc(i); if (s[i]>='0')and(s[i]<='9') then begin t:=0; repeat t:=t+(ord(s[i])-ord('0')); inc(i); until not((s[i]>='0')and(s[i]<='9')); for j:=1 to t do if s[i]<>'b' then write(s[i]) else write(' '); end else if s[i]='!' then writeln; until i=length(s); writeln; end; end.