讨论 / 90分
NEW WORLD 2013-11-04 04:49:01
点我顶贴 收藏 删除
var i,j,k,l,m,n,a,len,b,c,d:longint;

ar:array[1..1000]of string;

s1,s2,st:string;

begin

readln(st);

i:=1;

len:=length(st);

while (st[i]<>'E')and(i<=len) do

begin

case st[i] of

'W':begin inc(a);inc(c);end;

'L':begin inc(b);inc(d);end;

end;

inc(i);

if ((a>=11)or(b>=11))and(abs(a-b)>1) then

begin

writeln(a,':',b);

a:=0;b:=0;

end;

if ((c>=21)or(d>=21))and(abs(c-d)>1) then

begin

inc(k);

str(c,s1);

str(d,s2);

ar[k]:=s1+':'+s2;

c:=0;d:=0;

end;

if i>20 then

begin

readln(st);

i:=1;

end;

end;

writeln(a,':',b);

writeln;

for i:=1 to k do

writeln(ar[i]);

writeln(c,':',d);

end.

#1 NEW WORLD@2013-11-04 04:50:00
回复 删除
乒乓球,大牛围观,看看哪错了
查看更多回复
提交回复