Private Sub Command1_Click()
D.im n As Integer
n = InputBox("请输入")
t = Int(Sqr(n))
i = 2
flag = 0
While i <= t And flag = 0
If ______Then
flag = 1
E.lse: i = i + 1
E.nd If
Wend
If ______Then
Print "这是一个质数"
E.lse
Print "这不是一个质数"
E.nd If
E.nd Sub
[单选题](程序说明) 程序功能是判断一个自然数是否为质数。(程序)SET TALK OFFINPUT“请输入一个大于1的自然数:” (1)K=0 &&K值为0表示所输入的数是质数,为1表示不是质数J=2D.O WHILE J<NIF MOD(N,J) (2)(3)LOOPE.LSEK=1E.XITE.NDIFE.NDDOIF K=0? (4) +“是质数”E.LSE? “NO!”E.NDIFSET TALK ONRETURN(1)A.ON NB.TO NC.GO ND.INTO N
[主观题]下面是一个类的定义,试将程序补充完整。class A{String s;____int a=66;A.(String sl){s=sl;}static int geta(){return a;}}
[单选题]窗体上有一个组合框,编写下列程序:Private Sub Command1_ Click () Combo1. RemoveItem 2End subPrivate Sub form. Load() Combo1. AddItem “上海” Combo1. AddItem “北京” Combo1. AddItem “天津” Combo1. AddItem “重庆”End Sub程序执行时,单击Command1,则在组合框中将不再出现______。A.上海B.北京C.天津D.重庆
[单选题]在窗体上有一个命令按钮Command1,编写下列程序:Private Sub Command1_Click()Print pp1(3,7)E.nd SubPublic Function pp1(x As Single,n As Integer)As SingleIf n=0 Thenpp1=1E.lseIf n Mod 2=1 Thenpp1=x*x+nE.lsepp1=x*x-nE.nd IfE.nd IfE.nd Function程序运行后,单击该命令按钮,屏幕上显示的是( )。A.2B.1
[单选题]下列程序的执行结果为______。Private sub Command1_ Click ( ) a = 100 b = 50 if a <> b then a = a + b Else b = b -a Print a, bEnd SubA.50 50B.150 50C.200 200D.10 10
[单选题]下列程序的运行结果为______。Private Sub Command1_ Click() Dim s As Long Dim x As Integer s = 0 for x = 99 To 1 step - 2 s=s+ x Next x Print sEnd SubA.100B.500C.2500D.5000
[单选题]在窗体上有一个命令按钮Command1,编写如下程序: Private Sub Command1_Click() Print pp1(3, 7) End Sub Public Function pp1(x As Single, n As Integer) As Single If n = 0 Then pp1= 1 Else If n Mod 2 = 1 Then pp1 =x*x+n Else pp1 =x*x-n End If End If End Function 程序运行后,单击该命令按
[单选题]在窗体上有一个命令按钮Command1,编写如下程序: Private Sub Command1_Click() Print pp1(3,7) End Sub Public Function pp1(x As Single,n As Integer)As Single If n=0 Then pp1=1 Else If n Mod 2=1 Then pp1=x*x+n Else pp1=x*x-n End If End If End Function 程序运行后,单击该命令按钮,屏幕上显示的是(
[单选题]窗体上有一个按钮和一个列表框,执行下列程序后,输出的结果为 Private Sub Command1_Click() List1.AddItem "Visual" List1.AddItem "Basic" List1.AddItem "Programming", 1 Print list1.List(2) End SubA.VisualB.BasicC.ProgrammingD.2
[主观题]执行下列程序,输入数字3,则输出结果为______。Private Sub Command1_Click()a=inputBox("Input a Number")If a>5 ThenG.oTo L5E.lse If a>2 ThenG.oTo L2E.lseG.oTo L3E.nd IfE.xit SubL5:Print a Mod 5E.xit SubL3:Print a Mod 3E.xit SubL2:Print a Mod 2E.nd Sub