-
Notifications
You must be signed in to change notification settings - Fork 0
/
aaa.pas
46 lines (46 loc) · 1.03 KB
/
aaa.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
var
a:array[0..100000] of char;
ch:char;
t,i,x,y:longint;
begin
t:=0;
repeat
read(ch);
if (ch='W') or (ch='L') then
begin
inc(t);
a[t]:=ch;
end;
until ch='E';
x:=0;
y:=0;
for i:=1 to t do
begin
if a[i]='W' then inc(x);
if a[i]='L' then inc(y);
if abs(x-y)>=2 then
if (x>=11) or (y>=11) then
begin
writeln(x,':',y);
x:=0;
y:=0;
end;
end;
writeln(x,':',y);
writeln;
x:=0;
y:=0;
for i:=1 to t do
begin
if a[i]='W' then inc(x);
if a[i]='L' then inc(y);
if abs(x-y)>=2 then
if (x>=21) or (y>=21) then
begin
writeln(x,':',y);
x:=0;
y:=0;
end;
end;
writeln(x,':',y);
end.