永动机老师,我的作业如下

程序代码:
Close Databases
Use cs
Select kc from cs group by kc into array aGrp
Select xm, kc, Cast('' as V(50)) as suspect from cs where .f. into cursor result Readwrite
For m.ii = 1 to Alen(m.aGrp)
Select cs
Scan all for kc == m.aGrp[m.ii]
Scatter name oRec
m.oRec.ans = 0h + m.oRec.ans
Select xm, Bitxor(m.oRec.ans, 0h+ans) as op, Cast(0 as I) as diff ;
from cs where (kc == m.oRec.kc) and !(xm == m.oREc.xm) ;
into cursor temp Readwrite
Update temp set diff = Len(op) - Occurs(0h00, op)
Select xm, diff from temp where diff <= 3 order by diff into cursor temp
If Reccount('temp') > 0
m.cc = ''
Scan all
m.cc = m.cc + Textmerge(',<<Alltrim(xm)>>(不同:<<diff>>)')
EndScan
insert into result (xm, kc, suspect) Values (m.oRec.xm, m.oRec.kc, Substr(m.cc,3))
EndIf
EndScan
EndFor
Use in temp
Use in cs
Select result
Locate
Browse
[此贴子已经被作者于2023-9-17 10:15编辑过]