大牛们,帮我看看哪里错了

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 条评论

目前还没有评论...

信息

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