1
1) (m * n). .
Sub Main()
Dim A(,) As Single = {{15, 18, 19}, {10, 14, 28}, {9, 2, 13}, {3, 17, 23}}
Dim M, k, N, SUM, MIN As Integer
k = A.GetUpperBound(0)
Console.WriteLine(" A K+1={0}", k+1)
M = A.GetUpperBound(1)
Console.WriteLine(" A M+1={0}, M+1)
MIN = 0
N = 0
For i = 0 To k
SUM = 0
For j = 0 To M
SUM = SUM + A(i, j)
Next j
If (i = 0) Then
MIN = SUM
Else
If SUM < MIN Then
MIN = SUM
N = i
End If
End If
Next i
Console.WriteLine("N={0}, MIN={1}", N + 1, MIN)
Console.ReadLine()
End Sub
2) VB. f(x)=1\x, ,
Private Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
Dim x, y As Single
x = Val(TextBox1.Text)
y = 1 / x
If x = 0 Then
TextBox2.Text = " "
Else
TextBox2.Text = CStr(y)
End If
End Sub
Private Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button3.Click
End
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
End Class
3) . .
- , , , . .
- . , - , , . , , .
:
15
1) . .
Sub Main()
Dim A(,) As Single = {{15, 18, 19}, {10, 14, 28}, {9, 2, 13}, {3, 17, 23}}
Dim Y, N, M, MAX, MIN As Single
N = A.GetUpperBound(0)
Console.WriteLine(" A, N={0}", N + 1)
M = A.GetUpperBound(1)
Console.WriteLine(" A, M={0}", M + 1)
MIN = 0
MAX = 0
For i = 0 To N
For j = 0 To M
If i = 0 And j = 0 Then
MIN = A(i, j)
MAX = A(i, j)
Else
If MIN > A(i, j) Then
MIN = A(i, j)
End If
If MAX < A(i, j) Then
MAX = A(i, j)
End If
End If
Next j
|
|
Next i
Y = MAX / MIN
Console.WriteLine("Y={0}", Y)
Console.ReadLine()
End Sub
2) VB. :
=
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox1.Text = ""
End Sub
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim pi As Single
pi = 48 * Math.Atan(1 / 18) + 32 * Math.Atan(1 / 57) - 20 * Math.Atan(1 / 239)
TextBox1.Text = CStr(pi)
End Sub
3) VB( )
Visual Basic :
For... Next
While... Wend
Do... Loop
For...Next :
For <> = <> <>
[Step <>]
< > Next [<>]
. , , , . (). 1.
WHILE...WEND :
While < >
< >
Wend
, , , . , , c , .
DO...LOOP - ).
:
) Do While < >
< >
Loop
) Do Until < >
< >
Loop
, , , , While, , . Do Loop :
) Do
< >
Loop While < >
) Do
< >
Loop Until < > . .
13
1) a(i,j), i=1,2,3...8, j=1,2,3...8
Sub Main()
Dim n As Integer
n = 8
Dim A(n, n) As Single
For i = 1 To n
For J = 1 To n
If i = J Then
A(i, J) = i * J
Else
If i > J Then
A(i, J) = Math.Sin(i * J)
Else
A(i, J) = Math.Atan(i * J) / (2 * i + 3 * J)
End If
End If
Console.WriteLine("A({0},{1})={2}", i, J, A(i, J))
Next J
Next i
Console.ReadLine()
End Sub
2) VB. c d.
|
|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim x1, x2, c, d, Y As Single
x1 = Val(TextBox1.Text)
X2= Val(TextBox2.Text)
C = Val(TextBox3.Text)
d = Val(TextBox4.Text)
Y = ((Math.Sin(Math.Abs(c * x1 ^ 3 + d * x2 ^ 2 - c * d))) / Math.Sqrt((c * x1 ^ 3 + d * x2 ^ 2 - x1) ^ 2 + 3.14)) + Math.Tan(c * x1 ^ 3 + d * x2 ^ 2 - x1)
TextBox5.Text = CStr(Y)
End Sub
3) VB( )
.
Visual Basic .
Byte . 0 255, 1 .
Boolean . True False, 2 .
Currency . , 8 . ( 15 4 ).
Date . /, 8 .
Double , 8 .
Integer , 2 . -32768 32767.
Long , 4 . -2147483648 2147483647.
Single , 4 . -3.402823 38 -1.401298-45 1.401298-45 3.402823 38.
String . .
Variant . . 16 , .
Object . , 4 .
17
1) . , .
Sub Main()
Dim a(,) As Single = {{15, -18, 19}, {10, -14, 28}, {9, -2, 13}, {3, 17, -23}}
Dim N, M, min, max As Integer
N = a.GetUpperBound(0)
Console.WriteLine("N={0}", N + 1)
M = a.GetUpperBound(1)
Console.WriteLine("M={0}", M + 1)
min = 0
max = 0
For i = 0 To N
For J = 0 To M
If a(i, J) < 0 Then
min = min + a(i, J)
Else
max = max + a(i, J)
End If
Next J
Next i
Console.WriteLine("max={0}, min={1}", max, min)
Console.ReadLine()
End Sub
2) VB. . u, v,
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim x, y, u, v As Double
x = Val(TextBox1.Text)
y = Val(TextBox2.Text)
u = Math.Sqrt(Math.Exp(x + y))
v = (-Math.Log(Math.Exp(x + y)) + Math.Exp(1) - 1) / 2 * Math.Sqrt(Math.Exp(x + y))
TextBox3.Text = CStr(u)
TextBox4.Text = CStr(y)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
|
|
End
End Sub
VB( )
, : . , .
. , - .
18
. .
Sub Main()
Dim A(,) As Single = {{15, 18, 19}, {10, 14, 28}, {9, 2, 13}, {3, 17, 23}}
Dim N, M, B, S As Integer
N = A.GetUpperBound(0)
Console.WriteLine(" N={0}", N + 1)
M = A.GetUpperBound(1)
Console.WriteLine(" M={0}", M + 1)
B = Val(Console.ReadLine())
S = 0
For i = 0 To N
For j = 0 To M
If A(i, j) > B Then
S = S + 1
End If
Next j
Next i
Console.WriteLine("s={0}", S)
Console.ReadLine()
End Sub
2) VB. , z u, v,
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
End
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x, y, z, u, v As Single
x = Val(TextBox1.Text)
y = Val(TextBox2.Text)
z = Val(TextBox3.Text)
u = Math.Sin(Math.Abs(y - Math.Sqrt(Math.Abs(x)))) * (x - y / z ^ 2 + x ^ 2 / 4)
v = Math.Cos(z ^ 2 + x ^ 2 / 4)
TextBox4.Text = CStr(u)
TextBox5.Text = CStr(v)
End Sub
3)
.
, (, , 812 ) (, , ).
, . . , (, , ) . .
, . , -. , .
, , ( ). ( ) .
.
. .
Ethernet . (), - (), , .. .
, . . , . .
|
|
. , . .
, . , , .
, .