µ±Ç°Î»ÖãºÊ×Ò³ > ¸ßÖ°µ¥ÕÐVB³ÌÐòÁ·Ï°
1.private Sub Command1_Click ()
Dim a As Integer , b As Integer a=60 : b=a
print ¡°a=¡± ; a . ¡± b=¡±;b End Sub
ÉÏÃæ³ÌÐòÔËÐк󣬵¥»÷Command1mingling°´Å¥.Êä³ö½á¹ûÊÇ______. 2.Private Sub Command1_Click ()
Dim x As Integer ,y As Integer, z As Integer x=1: y=2 If x> 1 Then z=1
ElseIf x<>y Then z=2 Else z=3 End If
Print ¡±z=¡±;z End Sub
ÉÏÃæ³ÌÐòÔËÐк󣬵¥»÷Command 1ÃüÁî°´Å¥£¬Êä³ö½á¹ûÊÇ______. 3.ivate Sub Command1_Click() Dim s As String, n As Integer
S=¡±1a2b3c¡± N=Val(s)+23 Print n End Sub
ÉÏÃæ³ÌÐòÔËÐк󣬵¥»÷Command1 ÃüÁî°´Å¥£¬Êä³ö½á¹ûÊÇ______. 4.vate Sub Command1_Click() Dim i As Integer, sum As Integer Sum=0
For u = 1 to 10 step 2 Sum =sum +1 Next i
Print sum End Sub
ÉÏÃæ³ÌÐòÔËÐк󣬵¥»÷Command1 ÃüÁî°´Å¥£¬Êä³ö½á¹ûÊÇ______. 5.ivate Sub Command1_Click() Dim n As Integer n=1
While n<=5 n=n+1 Wend
Print ¡°n=¡± ; n End Sub
ÉÏÃæ³ÌÐòÔËÐк󣬵¥»÷Command1ÃüÁî°´Å¥£¬Êä³ö½á¹ûÊÇ_______¡£
6.Private Sub Command1_click() Dim i As Integer , s As String s=¡±¡±
For i= 1 To 6
If i Mod 3 = 0 Then s=s& ¡°$¡± Else
s=s& ¡°*¡± End If Next i
Print s End Sub
ÉÏÃæ³ÌÐòÔËÐк󣬵¥»÷Command1ÃüÁî°´Å¥£¬Êä³ö½á¹ûÊÇ_______¡£ 7.Private Sub Command1_click()
Dim x As Variant£¬max As Integer£¬n As Integer x=Array(7£¬2£¬4£¬,6£¬8£¬9) max=x(0) n=1 Do
If max Loop While n<6 Print ¡°max=¡±;max End Sub ÉÏÃæ³ÌÐòÔËÐк󣬵¥»÷Command1ÃüÁî°´Å¥£¬Êä³ö½á¹ûÊÇ_______¡£ 8.Private Sub Command1_click() x=InputBox(¡°Input x:¡±) x=x+¡±1¡± Print x End Sub ÉÏÃæ³ÌÐòÔËÐк󣬵¥»÷Command1ÃüÁî°´Å¥£¬ÔÚInputbox¶Ô»°¿òÖÐÊäÈë5432.²¢È·ÈϺó¡£Êä³öµÄ½á¹ûÊÇ_______¡£ 9.Private Sub Function testfun(ByVal n As Integer) Print testfun(5) End Sub Private Function testfun(ByVal As Integer) Dim i As Integer£¬t As Long t=1 For i = 1 To n Next i testfun=t End Function ÉÏÃæ³ÌÐòÔËÐк󣬵¥»÷Command1ÃüÁî°´Å¥£¬Êä³ö½á¹ûÊÇ_______¡£ 10.Private Sub Command1_click() Dim a As Integer£¬b As Integer Dim a As Integer£¬b As Integer A=30 £ºb=20 Call testsub(a£¬b) Print a , b End Sub Private Sub testsub(x As Ineger , y As Integer) x=x-y : y=x+y End Sub ÉÏÃæ³ÌÐòÔËÐк󣬵¥»÷Command1ÃüÁî°´Å¥£¬Êä³ö½á¹ûÊÇ_______¡£ Îå¡¢³ÌÐòÌî¿ÕÌâ(ÇëÕýÈ·Ìî³äÏÂÁеÄVB³ÌÐò£¬Ê¹ÆäÍê³ÉËùÐèÇóµÄ¹¦ÄÜ¡£Ã¿¿Õ2·Ö£¬¹²28·Ö) 1.ÇóºÍsum¡ª1*2+2*3+*¡+99*100 Private Sub Command1_Click() Dim i As Integer , sum As Long Sum=0 For i=1 To _________ Sum=sum+_______ Next i Print ¡°sum¡± ; sum End Sub 2.ÊäÈëÖ°¹¤µÄÄêÖÕ¿¼ºËµÃ·Ö£¬È»ºó½«¿¼ºËµÃ·Öת»»Îª¿¼ºËµÇ¼Ç£¬×ª»»¹æÔòÈçÏ£º90·ÖÒÔÉÏΪ¡±ÓÅ¡±¡£60~89·ÖΪ¡±ºÏ¸ñ¡±£¬ÆäËûΪ¡±²»ºÏ¸ñ¡±¡£ Private Sub Command1_click() Dim k As Integer k=inputbox(¡°ÇëÊäÈëÖ°¹¤µÄÄêÖÕ¿¼ºËµÃ·Ö : ¡±) Select Case k Case Is>=90 Print ¡°ÓÅ¡± Casse ______ Print¡±ºÏ¸ñ¡± ________ Print¡±²»ºÏ¸ñ¡± End Select End Sub 3.ÓöþÖØÑ»·Êä³öÈçÏÂͼ°¸(µÚÒ»Ðеġ± * ¡±ÁÐλÖÃÉèÖÃΪ20) * * * * * * * * * * * * * * * * * * * * * Private Sub Command1_click() Dim I As Integer , j As Integer For i1 To 6 Print______; For i = 1 To i Print ¡° * ¡°; Next j ______ Next i End Sub 4.´°ÌåForm1ÉÏÓÐÒ»¸öÃüÁŤCcommand1£¬µ¥»÷¸ÃÃüÁî°´Å¥¡£Òþ²ØForm1´°Ì壬ÏÔʾForm2´°Ìå¡£ Private Sub Command1_click() ______; Form2.______ End Sub 5.´°ÌåÉÏÓÐÒ»¸öÎı¾¿òText1,Ò»¸ö±êÇ©Label1ºÍÒ»¸öÃüÁî°´Å¥Command1£¬ÔÚÎı¾¿òÖÐÊäÈëÒ»¸öÔ²µÄ°ë¾¶Öµºó£¬µ¥»÷ÃüÁî°´Å¥£¬ÔÚ±êÇ©ÉÏÏÔʾԲµÄÃæ»ý¡£ Private Sub Command1_click() Dim r As Single , area As Single R=_________________________________ Area=3.14*r*r _________________________________=Str(area) End Sub 6.¸ø¶þάÊý×éA£¨4.4£©¸³³õÖµ£¬È¡ÖµÈçÏ£º 1 0 0 0 0 2 2 0 0 0 3 3 3 0 0 4 4 4 4 0 5 5 5 5 5 Private Sub Command1_click() Dim A(4 , 4) As Integer , I As Integer , j As Integer For i = 0 To 4 For j = 1 To 4 If ______ Then A(i , j)=0 Else A(i , j)=______ End If Next j Next i End Sub 7.ÓÃðÅÝ·¨¶ÔËæ¼´Éú³ÉµÄ20¸öÊä°´´Ó´óµ½Ð¡ÅÅÐò¡£ Private Sub Command1_click() Dim x(1 To 20) As Single Dim i As Integer , j As Integer , temp As Single For i = 1 To 20 x(i)=Rnd*101 Next i For i = 1 To 20 Step -1 For j=1 To ______ If______ Then temp=x(j) : x(j)=x(j+1) : x(j+1)=temp End If Next j Next i For j = 1 To 20 Print x(j) Next j End Sub
¹²·ÖÏí92ƪÏà¹ØÎĵµ