首页 > 学院 > 开发设计 > 正文

乒乓球

2019-11-08 02:34:26
字体:
来源:转载
供稿:网友
var c:array[1..500001] of char; n,i,s1,s2:longint;begin repeat  inc(n);  read(c[n]); until c[n]='E'; for i:=1 to n do  begin   if c[i]='W' then inc(s1);   if c[i]='L' then inc(s2);   if (abs(s1-s2)>=2)and((s1>=11)or(s2>=11)) then    begin writeln(s1,':',s2); s1:=0;s2:=0; end   else if i=n then writeln(s1,':',s2);  end; s1:=0;s2:=0; writeln; for i:=1 to n do  begin   if c[i]='W' then inc(s1);   if c[i]='L' then inc(s2);   if (abs(s1-s2)>=2)and((s1>=21)or(s2>=21)) then    begin writeln(s1,':',s2); s1:=0;s2:=0; end    else if i=n then writeln(s1,':',s2);  end;end.
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表