Keywords

April 2018
MonTueWedThuFriSatSun
      1
2345678
9101112131415
16171819202122
23242526272829
30      

Calendar Calendar


hovantri 123

Go down

hovantri 123

Bài gửi  hoangkhang on Mon Jan 14, 2013 7:38 pm


hoangkhang

Tổng số bài gửi : 6
Join date : 04/11/2012

Xem lý lịch thành viên

Về Đầu Trang Go down

Re: hovantri 123

Bài gửi  vuphong on Mon Jan 14, 2013 7:59 pm

Private Sub Command1_Click()
Dim a As Long
Dim b As Long
Dim c As Long
Dim d As Long
Dim delta As Long
Dim delta2 As Long
Dim k As Long
Dim kl As String
a = Val(Text3.Text)
b = Val(Text4.Text)
c = Val(Text5.Text)
d = Val(Text6.Text)
k = Val(Text11.Text)
delta2 = Val(Text12.Text)

If a = 0 And b = 0 And c = 0 And d = 0 Then
kl = "Phuong trinh co vo so nghiem"
X1 = ""
X2 = ""
X3 = ""
Text7.Text = kl
Text8.Text = X1
Text9.Text = X2
Text10.Text = X3
ElseIf a = 0 And b = 0 And c = 0 And d <> 0 Then
kl = "phöông trình voâ nghieäm"
X1 = ""
X2 = ""
X3 = ""
Text7.Text = kl
Text8.Text = X1
Text9.Text = X2
Text10.Text = X3
ElseIf a = 0 And b = 0 And c <> 0 Then
kl = "phuong trinh co 1 nghiem duy nhat"
X1 = Val(-d / c)
X2 = ""
X3 = ""
Text7.Text = kl
Text8.Text = X1
Text9.Text = X2
Text10.Text = X3
End If
If a = 0 And b <> 0 And c <> 0 Then
delta = c * c - 4 * b * d
End If
If a = 0 And b <> 0 And c <> 0 And delta < 0 Then
kl = "Phuong trinh vo nghiem"
X1 = ""
X2 = ""
X3 = ""
Text7.Text = kl
Text8.Text = X1
Text9.Text = X2
Text10.Text = X3
ElseIf a = 0 And b <> 0 And c <> 0 And delta = 0 Then
kl = "Phuong trinh co 1 nghiem kep"
X1 = Val(-c / (2 * b))
X2 = ""
X3 = ""
Text7.Text = kl
Text8.Text = X1
Text9.Text = X2
Text10.Text = X3
ElseIf a = 0 And b <> 0 And c <> 0 And delta > 0 Then
kl = "Phuong trinh co 2 nghiem phan biet"
X1 = Val((-c + Sqr(delta)) / (2 * b))
X2 = Val((-c - Sqr(delta)) / (2 * b))
X3 = ""
Text7.Text = kl
Text8.Text = X1
Text9.Text = X2
Text10.Text = X3
End If
If a <> 0 Then
delta2 = Val(b * b - 3 * a * c)
Text12.Text = delta2
End If
If delta2 <> 0 And a <> 0 Then
k = Val((9 * a * b * c) - (2 * b * b * b) - (27 * a * a * d)) / Sqr(Abs(delta2 * delta2 * delta2))
Text11.Text = k
End If
If a <> 0 And delta2 > 0 Then
kl = "Phuong trinh co 3 nghiem"
X1 = Val(((2 * Sqr(delta2) * Cos(((Atn(-k / Sqr(Abs(k * k) + 1))) + (2 * Atn(1))) / 3)) - b) / (3 * a))
X2 = Val(((2 * Sqr(delta2) * Cos((((Atn(-k / Sqr(Abs(k * k) + 1))) + (2 * Atn(1))) / 3)) - ((2 * 3.1457) / 3)) - b) / (3 * a))
X3 = Val(((2 * Sqr(delta2) * Cos((((Atn(-k / Sqr(Abs(k * k) + 1))) + (2 * Atn(1))) / 3)) + ((2 * 3.1457) / 3)) - b) / (3 * a))
Text7.Text = kl
Text8.Text = X1
Text9.Text = X2
Text10.Text = X3
ElseIf a <> 0 And delta2 > 0 And Abs(k) > 1 Then
kl = "Phuong trinh co 1 nghiem duy nhat"
X1 = Val((((Sqr(delta2) * Abs(k)) / (3 * a * k)) * ((Abs(k) + Sqr(k * k - 1)) ^ (1 / 3) + (Abs(k) - Sqr(k * k - 1)) ^ (1 / 3))) - (b / (3 * a)))
X2 = ""
X3 = ""
Text7.Text = kl
Text8.Text = X1
Text9.Text = X2
Text10.Text = X3
End If
If a <> 0 And delta2 = 0 Then
kl = "Phuong trinh co 1 nghiem boi" '(((can bac ba))))'
X1 = Val((-b + (b * b * b - 27 * a * a * d) ^ 1 / 3) / (3 * a))
X2 = ""
X3 = ""
Text7.Text = kl
Text8.Text = X1
Text9.Text = X2
Text10.Text = X3
End If
If a <> 0 And delta2 < 0 Then
kl = "Phuong trinh co 1 nghiem duy nhat" '(((can bac ba)))'
X1 = Val((Sqr(Abs(delta2)) / (3 * a)) * ((Abs(k + Sqr(k * k + 1)) ^ (1 / 3)) + (Abs(k - Sqr(k * k + 1)) ^ (1 / 3))))
X2 = ""
X3 = ""
Text7.Text = kl
Text8.Text = X1
Text9.Text = X2
Text10.Text = X3

End If
End Sub


Private Sub Command2_Click()
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
End Sub

Private Sub Command3_Click()
MsgBox "Are you sure""yes/no"
End
End Sub

vuphong

Tổng số bài gửi : 3
Join date : 04/12/2012

Xem lý lịch thành viên

Về Đầu Trang Go down

Về Đầu Trang


 
Permissions in this forum:
Bạn không có quyền trả lời bài viết