(單選,填字母) A.Form1=“尋找第n個素數(shù)” B.Form1.Name=“尋找第n個素數(shù)” C.Form1.Caption=“尋找第n個素數(shù)” D.Form1.Text=“尋找第n個素數(shù)” (2)請在①、②橫線處填入合適的代碼:加框處③代碼有錯誤,請改正。 Private Sub Command1_ Click ( ) Dim n As Integer,i As Integer Dim s As Integer,x As Integer,f As Boolean n=Val(Text1.Text) f=False:s=0 i=2 Do While①
For x=2 To i\2 If i Mod x=0 Then Exit For'Exit For用于退出For循環(huán) Next x. lf_ ②
Then s=s+1. If[i=n]Then'③
Label1.Caption=“第“& Str(n) &“個素數(shù)為:“& Str(i) f=True End If End If i=i+1 Loop End Sub
(2)實現(xiàn)解壓縮功能的程序代碼如下,請在橫線處填入合適的代碼。 Private Sub Command1_ Click ( ?。?br />Dim i As Integer,x1 As Integer,x2 As Integer,s As String Dim ch As String,result As String s=Text1.Text i=1:result=““ Do While i<=Len(s) ①
lfch<“O“Or ch>“g“Then Ifch=“/“Then x2=tmp Forj=1 To x2 result=result & CSstr(x1)'Cstr 函數(shù)的功能是將數(shù)字轉(zhuǎn)為字符串 Next j Else ②