一道vb题(懂的解) n=0 For i=1 To3 For j=5 To 1 step -1 n=n+1 Next j, i Print n; j; i
展开全部
如果按以下格式:
Private Sub Form_Load()
n = 0
For i = 1 To 3
For j = 5 To 1 Step -1
n = n + 1
Text3.Text = Text3.Text & vbCrLf & n & " - " & j & " - " & i
Next j
Next i
End Sub
结果是:n-j-i
1 - 5 - 1
2 - 4 - 1
3 - 3 - 1
4 - 2 - 1
5 - 1 - 1
6 - 5 - 2
7 - 4 - 2
8 - 3 - 2
9 - 2 - 2
10 - 1 - 2
11 - 5 - 3
12 - 4 - 3
13 - 3 - 3
14 - 2 - 3
15 - 1 - 3
如果按以下格式:
Private Sub Form_Load()
n = 0
For i = 1 To 3
For j = 5 To 1 Step -1
n = n + 1
Next j
Next i
Text3.Text = Text3.Text & vbCrLf & n & " - " & j & " - " & i
End Sub
结果是:n-j-i
15 - 0 - 4
Private Sub Form_Load()
n = 0
For i = 1 To 3
For j = 5 To 1 Step -1
n = n + 1
Text3.Text = Text3.Text & vbCrLf & n & " - " & j & " - " & i
Next j
Next i
End Sub
结果是:n-j-i
1 - 5 - 1
2 - 4 - 1
3 - 3 - 1
4 - 2 - 1
5 - 1 - 1
6 - 5 - 2
7 - 4 - 2
8 - 3 - 2
9 - 2 - 2
10 - 1 - 2
11 - 5 - 3
12 - 4 - 3
13 - 3 - 3
14 - 2 - 3
15 - 1 - 3
如果按以下格式:
Private Sub Form_Load()
n = 0
For i = 1 To 3
For j = 5 To 1 Step -1
n = n + 1
Next j
Next i
Text3.Text = Text3.Text & vbCrLf & n & " - " & j & " - " & i
End Sub
结果是:n-j-i
15 - 0 - 4
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询