(3) (4) (5) (6) (7) (8) (9) (10) (11) (12)
ÊÔÌâ7£¨28·Ö£©
¡Ì ¡Ì ¡Ì ¡Ì ¡Ì ¡Ì ¡Ì ¡Ì ¡Ì ¡Ì (15) (16) (17) (18) (19) (20) (21) (22) (23) (24) ¡Ì ¡Ì ¡Ì ¡Ì ¡Ì ¡Ì ¡Ì ¡Ì ¡Ì ¡Ì Dim a() As Single, n As Integer Private Sub Form_Load()
Command1.Caption = \Êý¾ÝÊäÈë\·Ö) Command2.Caption = \¼ÆËã\·Ö) End Sub
Private Sub Command1_Click() 'Êý¾ÝÊäÈë
Dim i As Integer (2·Ö) n = Text1.Text (2·Ö) ReDim a(n) (3·Ö) For i = 1 To n
a(i) = InputBox(\·Ö) Next i End Sub
Private Sub Command2_Click()
Dim y As Single, i As Integer, x As Single (1·Ö) x = Text2.Text (1·Ö) y = a(1) (1·Ö) For i = 2 To n
y = y + a(i) * x ^ (i - 1) (7·Ö) Next i
Label3.Caption = y (2·Ö) End Sub
2007Äê´ºÕã½Ê¡¸ßµÈѧУ¼ÆËã»úµÈ¼¶¿¼ÊԲο¼´ð°¸£¨¶þ¼¶ VB£©
ÊÔÌâ1¡«6 (ÿСÌâ3·Ö)
¢Å B ¢Æ A ¢Ç D ¢È C ¢É D ¢Ê C ¢Ë B ¢Ì A ¢Í A ¢Î B ¢Ï B ¢Ð D ¢Ñ A ¢Ò A ¢Ó D ¢Ô B ¢Õ D ¢Ö C ¢× C ¢Ø B (21)C (22)A (23)A (24)D ÊÔÌâ7 (28·Ö)
Private Function sum(Byval n As Integer) As Integer sum=0: n=Abs(n) while n>0
sum = sum + n mod 10: n=n\\10 Wend
End Function
Private Sub Command1_Click()
Dim a(10) As Integer, b(10) As Integer, i As Integer For i = 1 To 10
a(i) = InputBox(\ Next i
For i=1 To 8: Printf a(i); \ Print
For i=1 To 8: Printf b(i); \End Sub
VBÉÏ»ú¿¼ÊÔ³ÌÐòµ÷ÊÔÌâÑùÌâ(Ìî¿Õ)²Î¿¼´ð°¸
[Ìâ1] [Ìâ2] [Ìâ3] [Ìâ4] [Ìâ5] [Ìâ6] [Ìâ7] [Ìâ8] [Ìâ9] 1. dalt>0 2. dalt=0 3. Sqr(-dalt) 1. start = Space(21 - i) 2. Count = 19 - 2 * i 3. Form1.Print start; 4. Form1.Print 1. 5 2. num 3. Trim(i); 1.number(i) 2.n as integer 3.number=number*10+7 1. 1 2. -1 3. x=(x+1)*2 1. 2 2. b = False 3. k = k + 1 4. b »ò b = True 1.do while x<4 or x mod 2<>0 2.if isprime(i) and isprime(x-i) then 3.isprime=true 4.if x mod I=0 then 1. n+1 2. n Mod 3=1 and n Mod 5=1 and n Mod 7=1 3. While countN<5 1. Not isLeapYear(year) 2. y Mod 4 <> 0 3. y Mod 100 = 0 4. y Mod 400 <> 0 [Ìâ10] [Ìâ11] [Ìâ12] [Ìâ13] [Ìâ14] [Ìâ15] [Ìâ16] [Ìâ17] [Ìâ18] [Ìâ19] [Ìâ20]
1.trim(str(i)) 2.trim(str(i^2)) 3.x1=right(x2,len(x1)) 1. i\\100 2. i mod 10 3.i=hundred^3+ten^3+one^3 1. i,n 2.if i=s then 3.for I=2 to x-1»òfor i=2 to x\\2 4.a(k)=i 1. s = 1 2. Do While s < 1E+16 3. i = i + 1 1. s < 1000 2. x 3. n + 1 4. n - 2 1.sign=-1 2.19 3.sign=-sign 1.temp=1 2.temp 3.nfactor(i) 4.sum 1. 1 To Len(a) 2. n + fact(p) 3. fact = y 1.len(oldsen) 2.lastchar=\1. salary(i) 2. temp - hundred * 100 3. temp 4. totalsalary + salary(i) 1.Len(str1) 2.length-1 3.mid(str1,I,2) 4.sum=0 VBÉÏ»ú¿¼ÊÔ³ÌÐòµ÷ÊÔÌâÑùÌâ(¸Ä´í)²Î¿¼´ð°¸
[Ìâ1] [Ìâ2] [Ìâ3] [Ìâ4] [Ìâ5] [Ìâ6] [Ìâ7] 1.for i=9 to 1 step ¨C1 2. Form1.Print Trim(Str(i)); 3. End Sub 1.for two=1 to n-one 2.if one+two*2+five*5=60 then 3.next two 4.next one 1.dim k as single 2.for i=1 to 100 step2 3.k=-1/(i+1) 1.cmn=nfactor(m)/(nfactor(n)*nfactor(m-n)) 2.nfactor=temp 3.End function 1.length=len(str1) 2. strright=mid(str1,k,1) 3. strleft=mid(str1,length-k+1,1) 4. If strleft <>strright Then 1.case is>r 2.Loop until times>5 »ò Loop While times <= 5 3.Form1.print ¡°ÕýÈ·´ð°¸Îª¡±& str(r) 1.n=len(Hex) 2.temp=Mid(Hex,n-i,1) 3.Form1.print Hex + ¡°×ª»»ÎªÊ®½øÖÆÊýΪ¡± + str(Dec) »ò Form1.print Hex & ¡°×ª»»ÎªÊ®½øÖÆÊýΪ¡± & Dec »òForm1.print Hex ;¡°×ª»»ÎªÊ®½øÖÆÊýΪ¡± ; Dec 1. For i = 0 To 9 2. n = Int(Rnd * 90) + 10 3. MsgBox \żÊý¸öÊý£º\1.a(i)=int(Rnd*100) 2.p=a(i) mod 10 3.x(p)=x(p)+1 4.Form1.print ¡°¸öλÊýΪ¡±+str(p)+¡±¹²¡±+str(x(i)) + \¸ö\1.Swap a(j),a(i) 2.Loop while i
1. н¨Ò»¸ö¹¤³Ì£¬Íê³É¡°¼Ó·¨Æ÷¡±³ÌÐòµÄÉè¼Æ¡£ ²Î¿¼´ð°¸£º
Private Sub Command1_Click()
Text3.Text = Str(Val(Text1.Text) + Val(Text2.Text)) End Sub
Private Sub Command2_Click() Text1.Text = \ Text2.Text = \ Text3.Text = \ Text1.SetFocus End Sub
Private Sub Form_Load()
Form1.Caption = \¼Ó·¨Æ÷\ 'Îı¾¿òÇå¿Õ Text1.Text = \ Text2.Text = \ Text3.Text = \ 'ÉèÖÃÎı¾¿òÓÒ¶ÔÆë Text1.Alignment = 1 Text2.Alignment = 1 Text3.Alignment = 1 'ÆÁ±Î¶ÔText3µÄ±à¼ Text3.Locked = True Label1.Caption = \ Command1.Caption = \£½\ Command2.Caption = \Çå¿Õ\End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer) If (KeyAscii < 48) Or (KeyAscii > 57) Then KeyAscii = 0 End If End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer) If (KeyAscii < 48) Or (KeyAscii > 57) Then KeyAscii = 0 End If End Sub
2. н¨Ò»¸ö¹¤³Ì£¬Íê³É¡°½¡¿µ³Æ¡±³ÌÐòµÄÉè¼Æ¡£¾ßÌåÒªÇóÈçÏ£º ²Î¿¼´ð°¸£º
Private Sub Command1_Click() Dim bzh As Single
bzh = Val(Text1.Text) - 105
If Val(Text2.Text) > bzh * 1.1 Then
Label5.Caption = \Æ«ÅÖ£¬×¢ÒâÒûʳ\
ElseIf Val(Text2.Text) < bzh * 0.9 Then Label5.Caption = \Æ«ÊÝ£¬Ôö¼ÓÓªÑø\ Else
Label5.Caption = \Õý³££¬¼ÌÐø±£³Ö\ End If End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then 'ÊäÈë·ÇÊý×Ö KeyAscii=0 End If End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then 'ÊäÈë·ÇÊý×Ö KeyAscii=0 End If End Sub
3. н¨Ò»¸ö¹¤³Ì£¬Íê³ÉÓ¦ÓóÌÐòµÄÉè¼Æ£¬¾ßÌåÒªÇóÈçÏ£º
²Î¿¼´ð°¸£º
Private Sub Command1_Click() If Form1.WindowState = 0 Then Command1.Caption = \×îС»¯(&B)\Form1.WindowState = 2
Command1.Left = (Form1.Width - Command1.Width) / 2
Command1.Top = (Form1.ScaleHeight - Command1.Height) / 2 Else
Form1.WindowState = 0
Command1.Caption = \×î´ó»¯(&L)\
Command1.Left = (Form1.Width - Command1.Width) / 2
Command1.Top = (Form1.ScaleHeight - Command1.Height) / 2 End If End Sub
Ïà¹ØÍÆ¼ö£º