ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

µ{¦¡³]­pªº ¤T­Ó°ò¥»µ²ºc

µ{¦¡³]­pªº ¤T­Ó°ò¥»µ²ºc

¤@ ¶¶§Ç
¥H ¨â­ÓÅܼƪº­È¥æ´«§@¬° ½d¨Ò


¤G §PÂ_
¥H y= a*(x^2) + b*x + c = 0 ¨D®Ú¬°¨Ò¤l

¤T °j°é
¥H ¥[Á`¬° ½d¨Ò
¤Ñ¤U¬°¤½

¦^´_ 1# sjgau


    ¦³¨Ò¤l¶Ü? ªþ¥ó°Ñ¦Ò? ÁÂÁÂ
ss

TOP

' SEQUENTIAL µ{¦¡³]­pµ²ºcªº ½d¨Ò

Sub test()
   Dim a As Integer, b As Integer, c As Integer
   Randomize
   ' ³]©w¶Ã¼Æªº ºØ¤l¼Æ
   
   a = Int(Rnd * 6 + 1)
   b = Int(Rnd * 6 + 1)
   
   ' show a, b
   MsgBox ("a= " & a & ", b= " & b)
   
   ' swap a, b
   c = a
   a = b
   b = c
   
   MsgBox ("a= " & a & ", b= " & b)
End Sub
¤Ñ¤U¬°¤½

TOP

¦^´_ 3# sjgau


    Randomize ³¯­z¦¡
½Ð°Ñ¾\     ½d¨Ò     ¯S©Ê

ªì©l¤Æ¶Ã¼Æ²£¥Í¾¹¡C

»yªk

Randomize [number]

¿ï¾Ü©Ê¤Þ¼Æ number ¥i¥H¬O¤@«¬ºA¬° Variant ªº­È©Î¥ô¦ó¼Æ­È¹Bºâ¦¡¡C

½Ðª`·N

Randomize ¨Ï¥Î number ªº­È·í¦¨·sªº¶Ã¼ÆºØ¤l¨Ó°_©l¶Ã¼Æ²£¥Í¾¹¡A­Y­n±o¨ì¤@¶Ã¼Æ­È¡A«h¥i©I¥s Rnd ¨ç¼Æ¡C¦pªG¬Ù²¤ number¡A«h·|¥H§@·~¨t²Î²{¦b®É¶¡¨Ó·í°µ·sªº¶Ã¼ÆºØ¤l¡C

¦pªG¨S¦³©I¥s Randomize ¨Ó°_©l¶Ã¼Æ²£¥Í¾¹¡ARnd ¨ç¼Æ(¨S¦³¤Þ¼Æ)«h¨Ï¥Î¤W¦¸©I¥s Rnd ¨ç¼Æ©Ò±oªº¶Ã¼Æ­È·í°µ·sªº¶Ã¼ÆºØ¤l¡C

ªþµù ­Y·Q±o¨ì­«ÂЪº¶Ã¼Æ§Ç¦C¡A¥i¥H¦b©I¥s Randomize ¤§«e¥ý©I¥s Rnd ¨Ã¥B¶Ç¤J¤@¤p©ó 0 ªº¤Þ¼Æ­È¡C¥ú¬O¥Î¦P¼Ëªº¶Ã¼ÆºØ¤l©I¥s Randomize ¨â¦¸ªº¸Ü¡A¨Ã¤£·|±o¨ì¨â¦¸¬Û¦Pªº¶Ã¼Æ§Ç¦C¡C
¤Ñ¤U¬°¤½

TOP

Rnd ¨ç¼Æ
½Ð°Ñ¾\     ½d¨Ò     ¯S©Ê

¶Ç¦^¤@«¬ºA¬° Single ªº­È¡A¨ä¤º®e¬°¤@¶Ã¼Æ­È¡C

»yªk

Rnd[(number)]

¿ï¾Ü©Ê¤Þ¼Æ number ¥i¥H¬O¤@«¬ºA¬° Single ªº­È¡A©Î¥ô¦ó¼Æ­È¹Bºâ¦¡¡C

¶Ç¦^­È
¤Ñ¤U¬°¤½

TOP

¬Ý¨ì RND ¶Ç¦^ SINGLE, ´N«Ü¬ª®ð¡C
¦]¬° SINGLEªºÅܤơA¥u¦³ 2^24
¤j¬ù¬O 10^7, ¹ê¦b¬O ¤£°÷¥Î

©Ò¥H¡A¦pªG¦Û¤v¼g RND, ¥i¥H¦³ 2^31 ªºÅܤơA
¤~¤ñ¸û¹³¬O ¶Ã¼Æ
¤Ñ¤U¬°¤½

TOP

  1. Sub test1016()
  2.    Randomize
  3.    Dim a As Single, b As Single, c As Single
  4.    
  5.    a = Rnd * 90 + 10
  6.    b = Rnd * 90 + 10
  7.    
  8.    ' show a, b
  9.    MsgBox (" a= " & a & ", b= " & b)
  10.    
  11.    ' §Ú­Ì §Æ±æ a <= b
  12.    If (a > b) Then
  13.       ' ¦p¦ó§â a, b ªº­È¥æ´«
  14.       c = a
  15.       a = b
  16.       b = c
  17.       MsgBox ("*** ¥æ´«¥H«á a= " & a & ", b= " & b)
  18.    End If
  19. End Sub
½Æ»s¥N½X
¦^´_ 7# sjgau
¤Ñ¤U¬°¤½

TOP

  1. Sub test1016()
  2.    Dim no As Integer, sum As Integer, i As Integer
  3.    Dim chk As Double
  4.    no = 100
  5.    
  6.    sum = 0
  7.    For i = 1 To no
  8.       sum = sum + i
  9.    Next i
  10.    
  11.    ' Åçºâ
  12.    chk = (1# + no) * (no - 1# + 1#) / 2#
  13.    MsgBox ("no= " & no & ", sum= " & sum & ", check= " & chk)
  14. End Sub
½Æ»s¥N½X
¦^´_ 8# sjgau
¤Ñ¤U¬°¤½

TOP

        ÀR«ä¦Û¦b : ¡i°±º¢¤£«e¡A²×µL©Ò±o¡j¤H³£°g©ó´M§ä©_ÂÝ¡A¦]¦Ó°±º¢¤£«e¡FÁa¨Ï®É¶¡¦A¦h¡B¸ô¦Aªø¡A¤]¤FµL¥Î³B¡A²×µL©Ò±o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD