这个题本以为很简单,结果就得了10分。。
求高人指点
程序代码:
program pingpangqiu;
var result111,result211,result121,result221:array[1..25]of longint;
i,j,num11,num21,w11,L11,w21,yu,l21,k:longint;
ch:char;
a:array[1..100000]of char;
begin
assign(input,'pingpangqiu.in');
assign(output,'pingpangqiu.out');
reset(input);
rewrite(output);
repeat read(ch);
inc(k);
a[k]:=ch;
until ch='E';
for yu:=1 to k do
begin
case a[yu] of
'W':begin
inc(w11);inc(w21);
if w11+L11=11 then begin
inc(num11);
result111[num11]:=w11;
result211[num11]:=L11;
w11:=0;L11:=0;
end;
if w21+L21=21 then begin
inc(num21);
result121[num21]:=w21;
result221[num21]:=L21;
w21:=0;L21:=0;
end;
end;
'L':begin
inc(L11);inc(L21);
if w11+L11=11 then begin
inc(num11);
result111[num11]:=w11;
result211[num11]:=L11;
w11:=0;L11:=0;
end;
if w21+L21=21 then begin
inc(num21);
result121[num21]:=w21;
result221[num21]:=L21;
w21:=0;L21:=0;
end;
end;
'E':begin
for i:=1 to num11 do writeln(result111[i],':',result211[i]);
if (w11<>0)or(L11<>0) then writeln(w11,':',L11);
writeln;
for j:=1 to num21 do writeln(result121[j],':',result221[j]);
if (w21<>0)or(L21<>0) then writeln(w21,':',L21);
end;
end;
end;
close(input);
close(output);
end.