var a,b,c:integer; s:array[1..100]of integer; begin for a:=1 to 100 do s[a]:=-1; for a:=1 to 100 do for b:=1 to 100 do if (b mod a)=0 then s[b]:=-s[b]; {执行完后就有了所有服务员都干完活后的门开关状况,1为开,-1为关} for a:=1 to 100 do write(s[a],' '); end.
var i,j:integer; a:array[1..100]of boolean; begin for i:=1to 100do a[i]:=true; for i:=2to 100 do(人); for j:=1to 100 do(门); if j mod i=0then a[j]:=not (a[j]); for j:=1to 100 do if a[j]=true then write(j:5); end. 中间如有错, lz 自己改一改