[填空題] 執(zhí)行下面程序,在文本框Text1中輸入"21 23 2 3 5 17 54#"后,單擊命令按鈕Cmdl,數(shù)組元素A(1)的值是(),A(3)的值是(
2021-07-20
[填空題] 執(zhí)行下面程序,在文本框Text1中輸入"21 23 2 3 5 17 54#"后,單擊命令按鈕Cmdl,數(shù)組元素A(1)的值是(),A(3)的值是(),A(5)的值是().Option ExplicitPrivate Sub Cmd1_Click()Dim A() As Integer,K As IntegerDim L As Integer,S As StringS=Text1DoK=K+1ReDim Preserve A(K)L=InStr(S," ")If L0 ThenA(K)=Val(Left(S,L-1))S=Right(S,Len(S)-L)ElseA(K)=Val(S)End IfLoop Until L=0Call Exchang(A)For K=1 To 7Text2=Text2 &A(K) & " "Next KEnd SubPrivate Sub Exchang(A() As Integer)Dim i As Integer,Tem As IntegerDim Point1 As IntegerPoint1=1For i=1 To UBound(A)If A(i) Mod 3 =0ThenTem=A(i)A(i)=A(Point1)A(Point1)=TemPoint1=Point1+1End IfNext iEnd Sub
正確答案:21;54;5
詞條內(nèi)容僅供參考,如果您需要解決具體問(wèn)題
(尤其在法律、醫(yī)學(xué)等領(lǐng)域),建議您咨詢相關(guān)領(lǐng)域?qū)I(yè)人士。