- 乒乓球
- 2010-07-13 22:01:41 @
program p1217;
var a,b:array[1..1000,1..2]of longint;
c:char;
pd:boolean;
t1,t2,i:longint;
begin
t1:=1;
t2:=1;
pd:=true;
while pd=true do
begin
read(c);
case c of
'W':begin
inc(a[t1,1]);
if (a[t1,1]>=21) and (abs(a[t1,1]-a[t1,2])>=2) then inc(t1);
inc(b[t2,1]);
if (b[t2,1]>=11) and (abs(b[t2,1]-b[t2,2])>=2) then inc(t2);
end;
'L':begin
inc(a[t1,2]);
if (a[t1,2]>=21) and (abs(a[t1,1]-a[t1,2])>=2) then inc(t1);
inc(b[t2,2]);
if (b[t2,2]>=11) and (abs(b[t2,1]-b[t2,2])>=2) then inc(t2);
end;
'E':pd:=false;
end;
end;
for i:=1 to t2 do
writeln(b,':',b);
writeln;
for i:=1 to t1 do
writeln(a,':',a);
end.
0 条评论
目前还没有评论...