讨论 / 乒乓球?没错阿
one111piece 2008-09-26 04:55:00
点我顶贴 收藏 删除

var

i,j,k,l,m,n:integer;

a:array[0..1000] of char;

sc,so:integer;

begin

while a[i]<>’E’ do begin

i:=i+1;

n:=n+1;

read(a[i]);

end;

i:=0;

repeat

i:=i+1;

if a[i]=’W’ then sc:=sc+1;

if a[i]=’L’ then so:=so+1;

if sc=11 then begin

writeln(sc,’:’,so);

sc:=0;

so:=0;

end;

if so=11 then begin

writeln(sc,’:’,so);

sc:=0;

so:=0;

end;

if ((sc<>0) or (so<>0)) and (i=n-1) then

writeln(sc,’:’,so);

until i=n;

writeln;

begin

i:=0;

sc:=0;

so:=0;

repeat

i:=i+1;

if a[i]=’W’ then sc:=sc+1;

if a[i]=’L’ then so:=so+1;

if sc=21 then begin

writeln(sc,’:’,so);

sc:=0;

so:=0;

end;

if so=21 then begin

writeln(sc,’:’,so);

sc:=0;

so:=0;

end;

if ((sc<>0) or (so<>0)) and (i=n-1) then

writeln(sc,’:’,so);

until i=n;

end;

end.

大牛们帮我看看

查看更多回复
提交回复