屬性的屬性值改為“角谷猜想”. (2)為實(shí)現(xiàn)上述功能,請?jiān)跈M線處填入合適代碼. Private Sub Command1_Click ( ) Dim x As Long x=Val(Text1.Text)'將text1中的內(nèi)容賦值給x Do While x<>1 If
Then'x為奇數(shù)的情況 x=x*3+1 Else'x為偶數(shù)的情況 x=
List1.AddItem“x=“& Str(x)'將x的變化添加到list1上 Loop End Sub 橫線處①應(yīng)填入
.(單選,填字母:A.Text1/B.List1/C.Command1/D.Judge/E.判斷) (2)為實(shí)現(xiàn)上述功能,請?jiān)跈M線處填入合適的代碼. Private Sub Judge_Click( ?。〥im riqi As String,st As String Dim year As Integer,month As Integer,day As Integer Dim rn As Boolean,hefa As Boolean riqi=Text1.Text year=Val(Mid(riqi,1,4)) month=Val(Mid(riqi,5,2)) day=①
Then rn=True‘第②處 If year Mod 4=0And year Mod 100<>0Then rn=True hefa=True‘用于判斷是否為合法日期 If month=0Or month>12Then hefa=False If day=0Then hefa=False If (month=1Or month=3Or month=5Or month=7Or’與下一行語句同行 month=8Or month=10Or month=12)And day>31Then hefa=False If (month=4Or month=6Or month=9Or month=11)’與下一行語句同行 And day>30Then hefa=False If ③
Then hefa=False ’第③處,判斷閏年2月的天數(shù)是否合法 If month=2And Rn=False And day>28Then hefa=False If hefa=True Then st=st+“合法日期“Else st=st+“非法日期“ List1.AddItem st End Sub.