學號 |
姓名 |
性別 |
出生年份 |
戶籍所在地 |
注冊日期 |
是否住校 |
201802001 |
張立 |
男 |
2003 |
杭州市江干區(qū) |
2018/8/31 |
是 |
201901001 |
李紅 |
女 |
2004 |
杭州市西湖區(qū) |
2019/9/1 |
否 |
… |
… |
… |
… |
… |
… |
… |
下列關(guān)于該學生管理信息系統(tǒng)的描述,錯誤的是 ( )
For i = 1 To 3
For j = 1 To 6 - i
If a(j) > a(j + 1) Then t = a(j): a(j) = a(j + 1): a(j + 1) = t
Next j
Next i
數(shù)組元素 a(1)到 a(6)的數(shù)據(jù)依次為“55,31,19,42,37,23”,則此程序運行完成后數(shù)組元素的數(shù)據(jù)依次是 ( )
a(1) = 1: a(2) = 1
b(1) = 1: b(2) = 2
For i = 3 To 5
a(i) = a(i - 1) + a(i - 2)
b(i) = b(i - 1) + a(i)
Next i
執(zhí)行該程序段后,數(shù)組元素b(5)的值為( )
key=Val(Text1.Text)
s=“ ”
i = 1 : j = 10
Do While i <= j
m =(i+j)\2
s = s+ Str(a(m))
If a(m)> key Then j = m -1 Else i = m +1
Loop
Text2.Text = s
數(shù)組元素a(1)到a(10)的值依次為“2,3,5,8,9,10,13,17,19,20”。在文本框Text1中輸入待查找的數(shù),執(zhí)行該程序段,則文本框text2中顯示的內(nèi)容可能的是 ( )
圖 b
Private Function bw(x As Integer, y As String) As String
'函數(shù)bw功能:若二進制位數(shù)不足,通過在前面添"0"使得位數(shù)為4的倍數(shù)
Dim r As Integer, i As Integer
r = x Mod 4
If r <> 0 Then
For i = 1 To 4 - r
y = "0" + y
Next i
x = Len(y)
End If
bw=
End Function
Private Sub Command1_Click()
Dim m As String, n As Integer, i As Integer, a As Integer
Dim s As Integer, s1 As String, j As Integer
m = Text1.Text
n = Len(m)
Text2.Text = ""
m = ’調(diào)整 m 的位數(shù)為 4 的倍數(shù)
For i = 1 To n - 3 Step 4
s = 0
For j = i To i + 3
a = Val(Mid(m, j, 1))
s =
Next j
If s >= 10 Then
s1 = Chr(Asc("A") + s - 10)
Else
s1 = CStr(s) '函數(shù) CStr 類似于 Str,但無前導空格
End If
Text2.Text = Text2.Text + s1
Next i
End Sub
請回答下列問題:
Const n = 6
Dim a(1 To n * n) As Integer
Private Sub Form_Load() '產(chǎn)生 n * n 個數(shù)組元素,每行按 n 個數(shù)顯示在 list1 中
For i = 1 To n * n
a(i) = Int(Rnd * 90) + 10
s = s + Str(a(i))
If ① Then
List1.AddItem s
s = ""
End If
Next i
End Sub
Private Sub Command1_Click()
Dim i As Integer, j As Integer, w As Integer, s As String
For i = 1 To n * n
k = i
For j = k + n To ②
If a(k) > a(j) Then k = j
Next j
If Then t = a(k): a(k) = a(i): a(i) = t
Next i
'將排序后數(shù)組 a 的元素,按每行 n 個數(shù)顯示在 list2 中,代碼略
End Sub
① ②