i,f:longint;
b11,b21:array[1..2] of longint;
begin
repeat
f:=0;
readln(a);
s:=s+a;
for i:=1 to length(a) do if copy(a,i,1)=’E’ then f:=-1;
until f=-1;
b11[1]:=0;b11[2]:=0;
f:=0;
for i:=1 to length(s) do
begin
if copy(s,i,1)=’E’ then f:=-1;
if f=0 then
begin
if copy(s,i,1)=’W’ then b11[1]:=b11[1]+1 else b11[2]:=b11[2]+1;
if (b11[1]=11) or (b11[2]=11) then begin writeln(b11[1],’:’,b11[2]);b11[1]:=0;b11[2]:=0;end;
end;
end;
if (b11[1]<11) and (b11[2]<11) then writeln(b11[1],’:’,b11[2]);
writeln;
b21[1]:=0;b21[2]:=0;
f:=0;
for i:=1 to length(s) do
begin
if copy(s,i,1)=’E’ then f:=-1;
if f=0 then
begin
if copy(s,i,1)=’W’ then b21[1]:=b21[1]+1 else b21[2]:=b21[2]+1;
if (b21[1]=21) or (b21[2]=21) then begin writeln(b21[1],’:’,b21[2]);b21[1]:=0;b21[2]:=0;end;
end;
end;
if (b21[1]<21) and (b21[2]<21) then writeln(b21[1],’:’,b21[2]);
end.
有什么不对?