求大牛帮我看一下,怎么改进

var i:char;
len,p,h,r:longint;
a:array[1..10000] of char;
w:array[1..2] of longint;
l:array[1..2] of longint;
begin
while (i<>'E') do
begin
read(i);
len:=len+1;
a[len]:=i;
end;
len:=len-(len div 20)*2-1;
if (len div 11)<1 then begin
for r:=1 to len do
if a[r]='W' then w[1]:=w[1]+1
else if a[r]='L' then l[1]:=l[1]+1;
writeln('11:0');
writeln(w[1],':',l[1]);
writeln;
writeln('21:0');
write(w[1],':',l[1]);
w[1]:=0;l[1]:=0;
end
else begin

while(p<>(len div 11)) do
begin
for h:=1 to len do
begin
if a[h]='W' then w[1]:=w[1]+1
else if a[h]='L' then l[1]:=l[1]+1;
if (w[1]+l[1]>=11)and((w[1]-2=l[1])or(l[1]-2=w[1])) then begin
writeln(w[1],':',l[1]);
w[1]:=0;l[1]:=0;
p:=p+1;
end;
end;
end;

w[1]:=0;l[1]:=0;p:=0;

for h:= (len div 11)*11+1 to len do;
if a[h]='W' then w[1]:=w[1]+1
else if a[h]='L' then l[1]:=l[1]+1;
writeln(w[1],':',l[1]);

w[1]:=0;l[1]:=0;

begin
while(p<>(len div 21)) do
begin
for h:=1 to len do
begin
if a[h]='W' then w[1]:=w[1]+1
else if a[h]='L' then l[1]:=l[1]+1;
if (w[1]+l[1]>=11)and((w[1]-2=l[1])or(l[1]-2=w[1])) then begin
writeln(w[1],':',l[1]);
w[1]:=0;l[1]:=0;
p:=p+1;
end;
end;
end;
w[1]:=0;l[1]:=0;p:=0;
for h:= (len div 21)*21+1 to len do;
if a[h]='W' then w[1]:=w[1]+1
else if a[h]='L' then begin
l[1]:=l[1]+1;
writeln(w[1],':',l[1]);
end;
end;
end;
end.

1 条评论

  • @ 2013-07-08 11:02:37

    那个,这个题题意是有问题的,当年坑死我了,哈哈,那个,程序找不到了,百科一下,乒乓球的规则吧

  • 1

信息

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