执行访问违规???

01 var x1,y1,x2,y2:array[1..1000] of longint;

02 i,ans1,ans2:longint;

03 s:char;

04 begin

05 read(s);

06 ans1:=1;

07 ans2:=1;

08 fillchar(x1,sizeof(x1),0);

09 fillchar(x2,sizeof(x2),0);

10 fillchar(y1,sizeof(y1),0);

11 fillchar(y2,sizeof(y2),0);

12 while s'E' do

13 begin

14 if s='W' then

15 begin

16 inc(x1[ans1]);

17 inc(x2[ans2]);

18 end;

19 if s='L' then

20 begin

21 inc(y1[ans1]);

22 inc(y2[ans2]);

23 end;

24 if ((x1[ans1]>=11) and (x1[ans1]-y1[ans1]>=2))

25 or ((y1[ans1]>=11) and (y1[ans1]-x1[ans1]>=2)) then

26 begin

27 inc(ans1);

28 end;

29 if ((x2[ans2]>=21) and (x2[ans2]-y2[ans2]>=2))

30 or ((y2[ans2]>=21) and (y2[ans2]-x2[ans2]>=2)) then

31 begin

32 inc(ans2);

33 end;

34 read(s);

35 end;

36 for i:=1 to ans1 do

37 writeln(x1[i],':',y1[i]);

38 writeln;

39 for i:=1 to ans2 do

40 writeln(x2[i],':',y2[i]);

41 end.

0 条评论

目前还没有评论...

信息

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