讨论 / 标程
少年包工头 2008-06-07 18:50:00
点我顶贴 收藏 删除
program pingpong;

var

s:packed array [1..100000] of char;

c:char;

i,j,l,t1,t2:longint;

begin

repeat

i:=i+1;

read(c);

if c<>E then s[i]:=c;

until c=E;

for j:=1 to i do

begin

if s[j]=W then t1:=t1+1;

if s[j]=L then t2:=t2+1;

if (t1>=11) or (t2>=11) then if abs(t1-t2)>1 then begin

writeln(t1,:,t2);

t1:=0;

t2:=0;

end;

end;

writeln(t1,:,t2);

writeln;

t1:=0;

t2:=0;

for j:=1 to i do

begin

if s[j]=W then t1:=t1+1;

if s[j]=L then t2:=t2+1;

if (t1>=21) or (t2>=21) then if abs(t1-t2)>1 then begin

writeln(t1,:,t2);

t1:=0;

t2:=0;

end;

end;

writeln(t1,:,t2);

end.

#1 少年包工头@2008-06-07 18:50:00
回复 删除
上面的E=E,W=W,L=L.
查看更多回复
提交回复