'绝对全部正确,讲信用就给分吧,不给也会被baidu扣,别浪费
inpass = InputBox("请输入你的密码", "输入密码")
MsgBox "对不起!你是非法用户。"
2.以下程序的输出结果是 13 。
If (i Mod k) = 0 Then Exit For
If k = (i-1) Then print i
max = a(1,1) : max_i = 1: max_j = 1
If a(i,j)>max Then max = a(i, j)
1.下列程序执行时,要求输入一个密码,如果密码不正确则显示出非法用户的对话框。请填空:
Const PassWord="12345678"
Dim inpass As String
Inpass=___inputbox_________("请输入你的密码","输入密码")
If inpass=PassWord Then
Exit Sub
Else
_____msgbox_______"对不起!你是非法用户。"
Unload Me
End If
2.以下程序的输出结果是____13________。
X=12.7
X=Int(x +0.5)
Print X
3. 下面程序的功能是求100~999之间的所有素数,所谓素数是指只能被1和它本身整除的数。
Private Sub Form_Click()
Dim i As Integer
Dim k As Integer
For i = 100 To 999
For k = 2 To i - 1
If _____k mod i =0_____ Then
____exit for
End If
Next k
If ___k=i___Then
Print i
End If
Next i
End Sub
1.
Const PassWord = "12345678"
Dim inpass As String
inpass = InputBox("请输入你的密码", "输入密码")
If inpass = PassWord Then
Exit Sub
Else
MsgBox "对不起!你是非法用户。"
Unload Me
End If
2.
13
3.
Private Sub Form_Click()
Dim i As Integer
Dim k As Integer
For i = 100 To 999
For k = 2 To i - 1
If i Mod k = 0 Then
Exit For
End If
Next k
If i = k Then
Print i
End If
Next i
End Sub
4.
Option Base 1
Private Sub Form_Click()
Dim a(3, 4) As Integer, i As Integer, j As Integer
Dim max As Integer, max_i As Integer, max_j As Integer
Randomize
For i = 1 To 3
For j = 1 To 4
a(i, j) = Int((999 - 100) * Rnd) + 100
Next j
Next i
max = a(1, 1): max_i = 1: max_j = 1
For i = 1 To 3
For j = 1 To 4
If a(i, j) > max Then
max = a(i, j)
max_i = i
max_j = j
End If
Next j
Next i
Print max, max_i, max_j
End Sub