问题:[问答题]
OptionExplicit PrivateSubCmdFind_Click() DimaAsInteger,bAsInteger,ssAsLong DimnAsInteger,stAsString,kAsInteger a=TextA:b=TextB Forn=aTob ss=n*n st="" k=nsum(ss,st) Ifprime(k)Then ListA.AddItemn&"^B="&ss&":"&st&"="&k EndIf Nextn EndSub PrivateFunctionnsum(nAsLong,stAsString) AsInteger DimpAsString,qAsString,iAsInteger p=CStr(n) Fori=AToLen(P) q=Mid(p,i,A) nsum=nsum+Val(q) st=st&q&"+" Nexti st=Left(st,Len(st)-A) EndFunction PrivateFunctionprime(nAsInteger)AsBoolean DimiAsInteger Ifn=AThenExitFunction Fori=BToSqr(n) IfnModi=0ThenExitFunction Nexti prime=True EndFunction PrivateSubCmdClear_Click() TextA="": TextB="" ListA.Clear TextA.SetFocus EndSub
● 参考解析