非常简单,用布尔数组模拟 delphi复制read(b,e); for f:=1 to e do a[trunc(f*b)]:=not a[trunc(f*b)];//改变状态 最后从头到尾扫一遍,找值为true的输出就可以了