- 乒乓球
- 2014-10-04 21:03:01 @
program pingpang;
var
c:char;
a,b:array[1..100000] of longint;
i,k,l,m,n,p,o:longint;
begin
assign(input,'ping.in');
assign(output,'ping.out');
reset(input);
rewrite(output);
o:=0;
repeat
inc(o);
read(c);
if c='W' then
begin
inc(k);
inc(m);
end;
if c='L' then
begin
inc(n);
inc(l);
end;
if c='E' then
begin
if o=1 then
begin
writeln('0:0');
writeln;
writeln('0:0');
halt;
end;
if (m<>0) or (n<>0) then writeln(m,':',n)
else writeln('0:0');
inc(p);
a[p]:=k;
b[p]:=l;
break;
end;
if ((m>=11) or (n>=11)) and (abs(m-n)>1) then
begin
writeln(m,':',n);
m:=0;
n:=0;
end;
if ((k>=21)or(l>=21))and(abs(k-l)>1) then
begin
inc(p);
a[p]:=k;
b[p]:=l;
k:=0;
l:=0
end;
until false;
writeln;
for i:=1 to p-1 do
writeln(a[i],':',b[i]);
if (a[p]<>0) or (b[p]<>0) then writeln(a[p],':',b[p]);
close(input);
close(output);
end.