路易斯和苏茉h:关于usaco 2.1的castle

来源:百度文库 编辑:高考问答 时间:2024/05/12 05:21:48
其中有一个步骤是将输入数据转存在一个数组中,请大家帮忙看看我的程序错在哪里?
procedure setup(s1,s2:integer);
begin
if (s2<1) then exit else
if s1<s2 then setup(s1,s2 div 2)
else begin
if s2=1 then b[j,i,1{west}]:=true;
if s2=2 then b[j,i,2{north}]:=true;
if s2=4 then b[j,i,3{east}]:=true;
if s2=8 then b[j,i,4{south}]:=true;
end;
setup(s1-s2,s2 div 2);
end;

这个明显