①使用WinRAR或WinZIP軟件把報(bào)告文件壓縮
②把報(bào)告文件后綴名改成“rar”或“zip”
③把報(bào)告文件里的圖像全部刪除
④適當(dāng)調(diào)小圖像素材的分辨率后,再替換文件中的原圖像
⑤把報(bào)告文件另存為txt文本文件
i=1 : j=6 : k=0
key = Val( Textl.Text)
Do Whilei<= j
k=k+ 1
m= Int((i +j)/2+0.5)
If key = a(m) Then Exit Do
If key< a(m) Then j=m-1 Else i=m+ 1
Loop
文本框Text1中輸入27,執(zhí)行該程序段后,k的值為2,則a(1)到a(6)各元素可能的值是( )
李華編寫(xiě)了實(shí)現(xiàn)上述功能的程序,程序功能如下:程序運(yùn)行時(shí),在文本框Text1中輸入n(1<=n<=10)單擊“產(chǎn)生”按鈕Command1產(chǎn)生n×n個(gè)隨機(jī)數(shù),隨機(jī)數(shù)的范圍為[0,9],隨機(jī)存儲(chǔ)在數(shù)組a中,并以矩陣的形式在列表框List1上顯示。單擊“排序”按鈕Command2,對(duì)矩陣以“行”為單位進(jìn)行升序排序,并在列表框List2輸出排序后的矩陣。在程序運(yùn)行界面如下圖所示。
實(shí)現(xiàn)上述功能的VB程序如下,請(qǐng)?jiān)趧澗€(xiàn)處填入合適的代碼。
Dim n As Integer
Dim a(1 To 100) As Integer
Private Sub Command1_Click( )
Dim i As Integer, s As String
s = ""
For i = 1 To n * n
s = s + Str(a(i))
If i Mod n = 0 Then
List1.AddItem s
s = ""
End If
Next i
End Sub
Private Sub Command2_Click()
Dim i As Integer, j As Integer, t As Integer
Dim s As String
s = ""
For i = 1 To n * n
k = i
For j = i + 1 To
If a(j) < a(k) Then k = j
Next j
If k <> i Then t = a(k):a(k) = a(i):a(i) = t
If i Mod n = 0 Then
List2.AddItem s
s = ""
End If
Next i
End Sub