5.下列程序用来在窗体上输出如图2-35所示的数据。
Private Sub Form_Click()
Dim a(5, 5) As Byte, i As Byte, j As Byte
For i=1 To 5
For j=1 To 6一i
a(i, j)=_________
Next j,1
For i=2 To 5
For j =______To 5
a(i,j)=J+i-6
Next j,i
For i=1 To 5
Forj=1 To 5
Print a(ij);
Next j
_________
Next
End Sub
1 2 3 4 5
2 3 4 5 1
3 4 5 1 2
4 5 1 2 3
5 1 2 3 4
图2-35窗体上的输出数据
VB程序题5
答案:2 悬赏:60
解决时间 2021-03-09 11:09
- 提问者网友:猖狂醉薇
- 2021-03-08 22:47
最佳答案
- 二级知识专家网友:茫然不知崩溃
- 2021-03-08 23:31
Private Sub Form_Click()
Dim a(5, 5) As Byte, i As Byte, j As Byte
For i = 1 To 5
For j = 1 To 6 - i
a(i, j) = i + j - 1 '
Next j
Next i
For i = 2 To 5
For j = 6 - i + 1 To 5 '
a(i, j) = j + i - 6
Next j
Next i
For i = 1 To 5
For j = 1 To 5
Print a(i, j);
Next j
Print
Next i
End Sub
Dim a(5, 5) As Byte, i As Byte, j As Byte
For i = 1 To 5
For j = 1 To 6 - i
a(i, j) = i + j - 1 '
Next j
Next i
For i = 2 To 5
For j = 6 - i + 1 To 5 '
a(i, j) = j + i - 6
Next j
Next i
For i = 1 To 5
For j = 1 To 5
Print a(i, j);
Next j
Next i
End Sub
全部回答
- 1楼网友:你把微笑给了谁
- 2021-03-09 00:17
private sub form_click() dim t1 as integer, t2 as integer dim t3 as integer, t4 as integer dim i as integer t1 = 1 t2 = 2 t3 = 3 print t1; t2; t3; s = s + t1 + t2 + t3 for i = 1 to 27 t4 = (t1 + t2 + t3) / 2 s = s + t4 print t4; t1 = t2 t2 = t3 t3 = t4 next i print print "平均数是:" & s / 30 end sub
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯