
[填空题] 本程序的功能是找出10到60之间所有不可以表示成两个平方数之和的数,请完善本程序Option ExplicitPrivate Sub CmdFind_Click()Dim i As Integer,j As Integer,k As IntegerDim p As Integer,q As IntegerFor i=10 To 60For j=1 To Int(Sqr(i))()q=i-PIf q<>0 And judge(q) Then Exit ForNext jIf () Thenk=k+1Text1.Text=Text1.Text & i & " "If k Mod 5=0 Then Text1.Text=Text1.Text & vbCrlfEnd IfNext iEndSubPublic Function judge(ByVal x As Integer)As BooleanIf () Thenjudge=TrueElsejudge=FalseEnd IfEnd Function
正确答案:p=j*j;j=int(sqr(i))+1 或j>int(sqr(i));int(sqr(x))=sqr(x)
上一篇 [单项选择题] 执行下列程序,输出的结果为( )。 public class Test public static void main (String[] args) int a=10;
下一篇 [单项选择题] 下列关于Applet的方法中,哪个是返回HTML中设定的值A)getCodeBase( ) B)getParameter(String)C.getApplnfo( ) D)sh