level 2
这是程序段
program houzi2;
type duile=array [1..8] of boolean;
var a:duile;
i,n,p,k,q:integer;
s:boolean;
begin
write(*input the number*);
read(n);
for i:=1 to 8 do a[i]:=true;
s:=false;
i:=1;
while s=false do
begin
s:=true;
p:=0;
repeat
while a[i]=false do
i:=i+1;
while a[i+1]=false do
i:=i+1;
if i>8 then i:=i mod 8;
p:=p+1;
until p=n;
a[i]:=false;
q:=i;
for k:=1 to 8 do
if a[k]=true then s:=false;
end;
write(q);
end.
2014年10月04日 09点10分