请VB高手帮我解答一下这个题目。急用,答的好我给分!每个FOUND后面一行都有错误,请指出怎么改。
'------------------------------------------------'【程序改错】'----------------------------...
'------------------------------------------------
'【程序改错】
'------------------------------------------------
'题目:下面的程序段用于删除数组中指定位置的数字,
' 如果位置错误给出提示,否则分别显示删除前后
' 的数组元素
'------------------------------------------------
Option Explicit
Private Sub Form_Click()
Dim a(10) As Integer, x As Integer, i As Integer, k As Integer
For i = 1 To 10
a(i) = Int(Rnd * 90) + 10
Print a(i);
Next i
Print
x = InputBox("请输入要删除第几位数字")
If x > 0 And x <= 10 Then
'**********FOUND**********
For k = x To 10
'**********FOUND**********
a(k) = a(k - 1)
Next k
Print "删除后的数组:"
For i = 1 To 9
Print a(i);
Next i
Else
Print "删除位置错误"
'**********FOUND**********
End
End Sub 展开
'【程序改错】
'------------------------------------------------
'题目:下面的程序段用于删除数组中指定位置的数字,
' 如果位置错误给出提示,否则分别显示删除前后
' 的数组元素
'------------------------------------------------
Option Explicit
Private Sub Form_Click()
Dim a(10) As Integer, x As Integer, i As Integer, k As Integer
For i = 1 To 10
a(i) = Int(Rnd * 90) + 10
Print a(i);
Next i
x = InputBox("请输入要删除第几位数字")
If x > 0 And x <= 10 Then
'**********FOUND**********
For k = x To 10
'**********FOUND**********
a(k) = a(k - 1)
Next k
Print "删除后的数组:"
For i = 1 To 9
Print a(i);
Next i
Else
Print "删除位置错误"
'**********FOUND**********
End
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询