CLEAR
SET SAFETY OFF
DIMENSION hhb(10)
DIMENSION js(18)
USE 表
select * from 表 into array hhb
n=4 &&自行修改这个值
n1=1
USE 搜索表
ZAP
FOR a=n1 TO n
FOR b=n1 TO n
FOR c=n1 TO n
FOR d=n1 TO n
FOR e=n1 TO n
FOR f=n1 TO n
FOR g=n1 TO n
FOR h=n1 TO n
FOR i=n1 TO n
FOR j=n1 TO n
js(1)= 2+hhb(a)
js(2)= 8+hhb(b)
js(3)=6+hhb(c)
js(4)= 11+hhb(d)
js(5)= hhb(e)+hhb(f)
js(6)= 15+hhb(g)
js(7)= 12+hhb(h)
js(8)= hhb(i)+hhb(j) &&
js(9)= 11+hhb(c)
js(10)= 6+hhb(d)
js(11)= hhb(h)+hhb(i)
js(12)= 12+hhb(j)
js(13)= hhb(e)+hhb(g)
js(14)= 15+hhb(f)
js(15)= 2+hhb(b)
js(16)= 8+hhb(a)
js(17)= 15+hhb(e)
js(18)= hhb(a)+hhb(b)
cstr=""
ok=.F.
FOR k=1 TO 18
cstr=cstr+IIF(EMPTY(cstr),"",",")+TRANSFORM(js[k])
ENDFOR
nMin=MIN(&cstr)
nMax=MAX(&cstr)
cstr=""
FOR k=1 TO 18
IF AT(PADL(js[k],2,"0"),cstr)=0
cstr=cstr+PADL(js[k],2,"0")+" "
ELSE
ok=.T.
EXIT
ENDIF
ENDFOR
IF ok=.F. AND nMax-nMin<=17
APPEND BLANK
FOR x=1 TO 18
REPLACE ('列'+TRANSFORM(x)) WITH js(x)
ENDFOR
ENDIF
*---------------------------------------------------------
ENDFOR
ENDFOR
ENDFOR
ENDFOR
ENDFOR
ENDFOR
ENDFOR
ENDFOR
ENDFOR
ENDFOR
DELETE FILE *.bak
BROWSE
估计结果可能不多
[此贴子已经被作者于2018-8-2 23:33编辑过]