标题:这段代码,怎样使输出的数以一行10个这样的输出啊
只看楼主
小凤0423
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2014-1-6
结帖率:50%
 问题点数:0 回复次数:2 
这段代码,怎样使输出的数以一行10个这样的输出啊
Private Sub Command1_Click()
Dim n As Integer, d As String
For n = 100 To 300
    If n Mod 3 <> 0 Then
   Print n;
    End If
Next n
End Sub
2014-04-09 16:28
小凤0423
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2014-1-6
得分:0 
Private Sub Command1_Click()
自己解决了,哇咔咔~

Dim n As Integer, d As String, m As Integer
For n = 100 To 200
    If n Mod 3 <> 0 Then
        Print n;
        m = m + 1  '定义m,m的初始值为0
      If m Mod 10 = 0 Then
           Print vbCrLf   '输出10个数后打印回车键,使得一行以10个数输出
      End If
    End If
Next n
End Sub
2014-04-09 17:06
loveve
Rank: 4
等 级:业余侠客
威 望:1
帖 子:452
专家分:213
注 册:2005-4-11
得分:0 
Private Sub Command1_Click()
    Dim n, m As Integer, d As String
    m = 0
    For n = 100 To 300
        If n Mod 3 <> 0 Then
            Print n;
            m = m + 1
        End If
        If (m Mod 10) = 0 Then
            Print Chr(13)
        End If
    Next n
End Sub

五月的雪
2014-04-09 17:08



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-429877-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.320761 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved