【问题标题】:visual basic 2010 nested loopsvisual basic 2010 嵌套循环
【发布时间】:2015-02-08 03:11:21
【问题描述】:

大家好,我的名字是 hibari,我目前正在做嵌套循环练习,我无法解决这个问题.....提前谢谢你,

'清空列表 清除列表()

    'process an outer loop
    For intOuterLoop As Integer = 1 To 5
        'process a nested (inner) loop
        For intInnerLoop As Integer 1 to 6
            lstData.Items.Add(intOuterLoop.ToString & ", " & intInnerLoop.ToString)
        Next
    Next
End Sub

每次我点击调试按钮时都会出现错误(语法错误)

【问题讨论】:

    标签: visual-studio-2010


    【解决方案1】:
    'process an outer loop
    For intOuterLoop As Integer = 1 To 5
        'process a nested (inner) loop
        For intInnerLoop As Integer = 1 to 6
            lstData.Items.Add(intOuterLoop.ToString & ", " & intInnerLoop.ToString)
        Next
    Next
    

    结束子

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-16
      • 2019-07-23
      • 1970-01-01
      • 1970-01-01
      • 2021-07-26
      • 2011-11-22
      相关资源
      最近更新 更多