[填空题]本程序的功能是:找出所有满足各位数字之和正好是其所有质因子之和的三位数。例如378,其各位数字之和为18,而其质因子2,3,3,3,7之和也是18,所以378是满足条件的数。OptionExplicitPrivateSubCmdFind_Click()DimiAsInteger,pAsString,stAsString,st1AsStringFori=100To999()Ifcsum(i)=zyz(i,st)Thenp=CStr(i)st1=Left(p,1)&"+"&Mid(p,2,1)&"+"&Right(p,1)List1.AddItemi&":"&st1&"="&Left(st,Len(st)-1)EndIfNextiIfList1.ListCount=0ThenList1.AddItem"无满足要求的数!"EndIfEndSubPrivateFunctioncsum(mAsInteger)AsInteger’求各位数字之和DimiAsInteger,pAsStringp=CStr(m)Fori=1ToLen(p)()NextiEndFunctionPrivateFunctionzyz(ByValmAsInteger,stAsString)AsInteger’求所有质因子之和DimiAsIntegeri=2DoIfmModi=0Thenzyz=zyz+ist=st&i&"+"m=miEIse()EndIfLoopUntil()EndFunction
[填空题]请完善程序(程序文件名:Java_1.java)并进行调试。请在下画线处填入正确内容,然后删除下画线。请勿删除注释行和其他已有的语句内容。
[题目要求]
完成程序并运行,得到的结果如下图所示。
源程序:
importjavax.swing.JOptionPane;
publicclassJava_1
publicstaticvoidmain(Stringargs[])
Stringoutput="";
for(intcount=1;count<=10;(1))
if(count(2))
continue;//当count为5时跳过循环中的剩余代码
output+=count+"":
output+="Usedcontinuetoskipprinting5":
JOptionPane.showMessageDialog(null,output);
System.exit(0);