更多“有如下VB程序段:Dim c As String, a As Booleana = FalseIf Not a Then c = Chr(Asc("A") + 2) Else c = Chr(Asc(…”相關(guān)的問題
第1題
有如下VB程序段:s=0Fori=10To1Step-3s=s+1nextiprints執(zhí)行結(jié)束后s的值是()。
點(diǎn)擊查看答案
第2題
有如下VB 程序段:s = 1For i = 2 To 10 Step 3 s = s + iNext i則該程序段執(zhí)行后,變量s 和i 的值分別是()
A.16, 11
B.15, 13
C.55, 11
D.25, 13
點(diǎn)擊查看答案
第3題
有如下VB程序段:a(1) = 1:a(2) =1:b(1) =1:b(2 ) = 2For i = 3 To 5a(i) = a(i-1) + a(i-2)b(i) = b(i-1) + a(i)Next i執(zhí)行該程序段后,數(shù)組元素b(5)的值為()
點(diǎn)擊查看答案
第4題
有如下VB程序段,其程序結(jié)構(gòu)是()。i=InputBox("請輸入一個(gè)非零數(shù)字")Ifi>0ThenPrint"該數(shù)是正數(shù)"ElsePrint"該數(shù)是負(fù)數(shù)"EndIf
A.順序結(jié)構(gòu)
B.選擇結(jié)構(gòu)
C.循環(huán)結(jié)構(gòu)
D.嵌套結(jié)構(gòu)
點(diǎn)擊查看答案
第5題
有如下VB程序段:For i = 1 To 100 j = 1∶a(j) = a(j) + 1 Do While a(j) = 6a(j) = 0j = j + 1a(j) = a(j) + 1 LoopNext i數(shù)組a中各個(gè)元素值均為0,該程序段執(zhí)行后數(shù)組a中各元素之和為()
點(diǎn)擊查看答案
第6題
有如下VB程序段:c = 0 :i = 1Do While i <=6 k = i For j = i + 1 To 7 If a(j)<= a(k) Then k = j Next j If a(i) <> a(k) Then t = a(i): a(i) = a(k): a(k) = t c = c + 1 End If i = i + 1Loop數(shù)組元素a(1)到a(7)的值依次為“9,9,8,16,45,9,78”。該程序段執(zhí)行后,變量c的值是()
點(diǎn)擊查看答案
第7題
有如下VB程序段:For i = 1 To 9 Step 2 b(a(i) Mod 10) = b(a(i) Mod 10) + 1Next is = 0For i = 0 To 9 Step 3 s =s + b(i)Next i數(shù)組b各元素初始值為0, 數(shù)組元素a(1)到a(9)的值依次為“29,74,12,38,16,45,21,57,33”,則執(zhí)行該程序段后,s的值為()
點(diǎn)擊查看答案
第8題
有如下VB程序段:a(1) = 1: a(2) = 2: a(3) = 4: a(4) = 5: a(5) = 6: a(6) = 7: a(7) = 8i = 1: j = 7Do While i < j m = (i + j) \ 2 If a(m) > m Then j = m Else i = m + 1 End IfLoopLabel1.Caption = Str(i)該代碼運(yùn)行后,標(biāo)簽對象Label1中輸出的值為()
點(diǎn)擊查看答案
第9題
在VB中有如下程序段:PrivateSubCommand1_Click()Dima,bAsIntegera=21:b=43IfbModa=0ThenPrint"b是a的倍數(shù)"ElsePrint"b不是a的倍數(shù)"EndIfEndSub其結(jié)構(gòu)為()。
A.順序結(jié)構(gòu)
B.樹形結(jié)構(gòu)
C.循環(huán)結(jié)構(gòu)
D.選擇結(jié)構(gòu)
點(diǎn)擊查看答案
第10題
某 VB 程序段如下:i = 1Do While i <= 3k = ij = i + 1Do While j <= 5If a(j) < a(k) Then k = jj = j + 1LoopIf i <> k Then t = a(i)a(i) = a(k)a(k) = tEnd Ifi = i + 1Loop數(shù)組元素a(1)到a(5)的值依次為“17,87,36,22,45”,則該程序段運(yùn)行后,數(shù)組元素a(1)到a(5)的數(shù)據(jù)依次是()
A.87, 45, 36, 17, 22
B.17, 22, 36, 45, 87
C.17, 22, 36, 87, 45
D.87, 45, 17, 36, 22
點(diǎn)擊查看答案
第11題
假定定義了一個(gè)記錄類型,名為Rt,同時(shí)建立了一個(gè)名為Sp.txt的文件,然后編寫如下的程序段: Dim
Rv As Rt r1=Len(Rv) Open"Sp.txt" For Random As 1 x=LOF(1) n=x\r1 執(zhí)行上面的程序段后,變量n中存放的是文件【 】中所存放的是【 】記錄類型的記錄數(shù)。
點(diǎn)擊查看答案