AC标程

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.

0 条评论

目前还没有评论...

信息

ID
1217
难度
7
分类
字符串 点击显示
标签
递交数
18613
已通过
4247
通过率
23%
被复制
33
上传者