更多“有如下VB程序段:For i= 1 To 49 j=1:a(j)=a(j)+1 Do While a(j)=5 a(j)=0 j = j + 1 a(j) = a(j) + 1 LoopNext i數(shù)…”相關的問題
第1題
有如下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)的值為()
點擊查看答案
第2題
有如下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中各個元素值均為0,該程序段執(zhí)行后數(shù)組a中各元素之和為()
點擊查看答案
第3題
有如下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的值是()
點擊查看答案
第4題
有如下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的值為()
點擊查看答案
第5題
有如下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)該代碼運行后,標簽對象Label1中輸出的值為()
點擊查看答案
第6題
有如下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
點擊查看答案
第7題
某 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”,則該程序段運行后,數(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
點擊查看答案
第8題
有如下VB程序段,其程序結構是()。i=InputBox("請輸入一個非零數(shù)字")Ifi>0ThenPrint"該數(shù)是正數(shù)"ElsePrint"該數(shù)是負數(shù)"EndIf
A.順序結構
B.選擇結構
C.循環(huán)結構
D.嵌套結構
點擊查看答案
第9題
某對分查找算法的vB程序段如下:i = 1 : j = 10 : nx = 0Key = Int(Rnd * 100) + 0. 5Do While i <= jm = (i + j) \ 2If Key = a(m) ThenExit Do ' Exit Do表示退出循環(huán)ElseIf Key < a(m)Thenj = m – 1 : nx = nx - 1Elsei = m + 1 : nx = nx + 1End IfLoopText1. Text = Str(nx)已知數(shù)組元素a(1)到a(10)的值依次為“11,26,37,49,55,62,78,79,85,98”。若執(zhí)行該程序后,文本框Text1中顯示的內容不可能是()
點擊查看答案
第10題
有如下VB程序:PrivateSubForm_Click()DimiAsIntegeri=-Abs(-3)Mod2>-1PrintiEndSub當單擊窗體時i的值是()。
點擊查看答案
第11題
在VB程序中有以下程序段:For i=10 To 1 Step -2Print"*"Nexti語句“Print"*"”的執(zhí)行次數(shù)是()。
點擊查看答案