¸Ñ¤@¤¸¤G¦¸¤èµ{¦¡¡D¡D¡D¡]·¸¦ì°ÝÃD¡^¨D¸Ñ
- ©«¤l
- 27
- ¥DÃD
- 11
- ºëµØ
- 0
- ¿n¤À
- 38
- ÂI¦W
- 0
- §@·~¨t²Î
- window
- ³nÅ骩¥»
- window7
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2019-12-12
- ³Ì«áµn¿ý
- 2021-4-21
|
¸Ñ¤@¤¸¤G¦¸¤èµ{¦¡¡D¡D¡D¡]·¸¦ì°ÝÃD¡^¨D¸Ñ
½Ð°Ý¦U¦ì¤j¤j¡A¡@¤U±µ{¦¡¦³·¸¦ì°ÝÃD¡H
½Ð°Ý¦p¦ó¸Ñ¡H¡H¡H- Sub ¸Ñ¤@¤¸¤G¦¸¤èµ{¦¡()
- Dim X1 As String, X2 As String
- If B ^ 2 - 4 * A * C >= 0 Then
- X1 = (-1 * B + (B ^ 2 - 4 * A * C) ^ 0.5) / (2 * A)
- X2 = (-1 * B - (B ^ 2 - 4 * A * C) ^ 0.5) / (2 * A)
- If InStr(X1, ".") <> 0 Then
- Text4.Text = Format(X1, "0.00")
- Else
- Text4.Text = X1
- End If
- If InStr(X2, ".") <> 0 Then
- Text5.Text = Format(X2, "0.00")
- Else
- Text5.Text = X2
- End If
- Else
- If B ^ 2 - 4 * A * C = 0 Then
- X1 = (-1 * B) / (2 * A) '«®Ú
- X2 = (-1 * B) / (2 * A) '«®Ú
- If InStr(X1, ".") <> 0 Then
- Text4.Text = Format(X1, "0.00")
- Else
- Text4.Text = X1
- End If
- If InStr(X2, ".") <> 0 Then
- Text5.Text = Format(X2, "0.00")
- Else
- Text5.Text = X2
- End If
- Else
- MsgBox "¥»¤èµ{¦¡µL¹ê¼Æ¸Ñ", vbExclamation
- End If
- End If
- End Sub
- Private Sub Command1_Click()
- Dim A As Integer, B As Integer, C As Integer
- A = Val(Text1.Text)
- B = Val(Text2.Text)
- C = Val(Text3.Text)
- ¸Ñ¤@¤¸¤G¦¸¤èµ{¦¡ A, B, C
- End Sub
- Private Sub Command2_Click()
- Text1.Text = ""
- Text2.Text = ""
- Text3.Text = ""
- Text4.Text = ""
- Text5.Text = ""
- End Sub
- Private Sub Text1_KeyPress(KeyAscii As Integer)
- If InStr("0123456789-" & Chr(8) & Chr(13), Chr(KeyAscii)) = 0 Then KeyAscii = 0
- If Len(Text1.Text) = 2 Then
- If Left(Text1.Text, 1) <> "-" Then
- Text1.Text = Left(Text1.Text, 1)
- End If
- End If
- End Sub
½Æ»s¥N½X ÁÂÁ |
|
Ian
|
|
|
|
|