vb作业,完全不会
发布网友
发布时间:2022-06-02 12:23
我来回答
共2个回答
热心网友
时间:2023-10-19 15:34
打开VB,新建标准EXE文件,在窗体上画个按钮,添加如下代码:
Private Sub Command1_Click()
Dim i As Integer
Dim Array1()
Dim Array2()
Dim Array3(7) As Integer
Array1 = Array(2, 8, 7, 6, 4, 28, 70, 25)
Array2 = Array(79, 27, 32, 41, 57, 66, 78, 80)
For i = 0 To 7
Array3(i) = Array1(i) + Array2(i)
Next i
For i = 0 To 7
Print Array3(i)
Next i
End Sub
单击按钮,在窗体上打印出结果。
热心网友
时间:2023-10-19 15:35
Private Sub Command1_Click()
Dim a$(), b$(), c%()
a = Split("2 8 7 6 4 28 70 25", " ")
b = Split("79 27 32 41 57 66 78 80", " ")
ReDim c(7)
For i = 0 To 7
c(i) = Val(a(i)) + Val(b(i))
Print c(i);
Next
End Sub