. 4.3-9.
Option Strict On Option Explicit On Imports System.Math Public Class Form1 ' TextBox Function vvod(ByVal T As TextBox) As Single Return CSng(Val(T.Text)) End Function ' TextBox Sub vivod(ByVal Z As Single, ByVal T As TextBox) T.Text = CStr(Z) End Sub ' Public Function (ByVal x1 As Single, _ ByVal y1 As Single, ByVal x2 As Single, _ ByVal y2 As Single) As Single Return CSng(Sqrt((x2 - x1) ^ 2 + (y2 - y1) ^ 2)) End Function ' Sub PS(ByVal x1 As Single, ByVal y1 As Single, _ ByVal x2 As Single, ByVal y2 As Single, _ ByVal x3 As Single, ByVal y3 As Single, _ ByRef P As Single, ByRef S As Single) Dim A, B, C, Pp As Single A = (x1, y1, x2, y2)' - - .. B = (x2, y2, x3, y3) C = (x3, y3, x1, y1) P = (A + B + C): Pp = P / 2 S = CSng(Sqrt(Pp * (Pp - A) * (Pp - B) * (Pp - C))) End Sub ' Button1 Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Dim x1 As Single, x2 As Single, x3 As Single Dim y1 As Single, y2 As Single, y3 As Single Dim As Single, As Single x1 = vvod(TextBox1): x2 = vvod(TextBox2): x3 = vvod(TextBox3) y1 = vvod(TextBox6): y2 = vvod(TextBox7): y3 = vvod(TextBox8) PS(x1, y1, x2, y2, x3, y3, , ) vivod(, TextBox4): vivod(, TextBox5) End Sub Private Sub Button2_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button2.Click End End Sub End Class |
. 4.3-9
. 4.3-10.
.
. 4.3-10
A = = 2.82843 B = = 2
C = = 2 = + + = 6.828427; = /2 = 3.414213 S= = 2
.
VB-, .
1. ?
2. ?
3. ?
4. ?
5. ?
6. ?
7. ?
8. ?
9. ?
10. ?
11. ?
12. ?
13. ?
14. ?
|
|
15. ?
16. ?
17. , (, ) ?
18. ?
19. ?
20. ?
21. .
22. ?
23. ?
24. ?
25. ?
26. ?
27. ?
28. ?
29. , ?
30. VB?
31. ?
32. ?
33. : , , ?
34. ?
35. ?
36. ?
37. ?
38. ?
39. ?
40. ?
41. ?
42. ?
43. ?
44. , ?
45. ?
46. ?
47. , - ?
48. , - ?
49. - ?
50. ?
51. ?
52. ?
53. , Public?
54. Private?
55. ?
56. ?
57. () ?
58. ?
59. ?