| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 608 人关注过本帖
标题:【求助】乘法表的显示效果不满意,请帮忙优化!
只看楼主 加入收藏
netstat09
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2010-11-19
结帖率:100%
收藏
已结贴  问题点数:0 回复次数:1 
【求助】乘法表的显示效果不满意,请帮忙优化!
【求助】乘法表的显示效果不满意,请帮忙优化!
刚开始学 在学For的时候想用for做一个能够输出乘法表的题
代码如下:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim intCS As Integer
        Dim intBS As Integer = 0
        ListBox1.Items.Clear()
        For intBeiShu As Integer = 1 To 9
            intBS = intBS + 1
            intCS = 0
            For intChengShu As Integer = 1 To intBS
                intCS = intCS + 1
                Dim intJi As Integer = intCS * intBS
                ListBox1.Items.Add(intCS & "x" & intBS & "=" & intJi)
            Next
        Next
    End Sub
以上虽然能显示
1x1=1

9x9=81
但是我想要的效果是:
1x1=1
1x2=2  2x2=4
.........
1x9=9  2x9=18  3x9=27  4x9=36  5x9=45  6x9=54  7x9=63  8x9=72  9x9=81
不知道有什么办法可以得到乘法表的显示效果。
搜索更多相关主题的帖子: 乘法表 效果 
2010-11-19 08:20
不说也罢
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:贵宾
威 望:39
帖 子:1481
专家分:4989
注 册:2007-10-7
收藏
得分:20 
程序代码:
        Dim intCS As Integer
        Dim intBS As Integer = 0
        Dim tt As String = ""
        ListBox1.Items.Clear()
        For intBeiShu As Integer = 1 To 9
            intBS += 1
            intCS = 0 : tt = ""
            For intChengShu As Integer = 1 To intBS
                intCS += 1
                Dim intJi As Integer = intCS * intBS
                tt += (intCS & "x" & intBS & "=" & intJi & Space(1))
            Next
            ListBox1.Items.Add(tt)
        Next

===================================================
讨厌C#的行尾的小尾巴;和一对大括号{ }
===================================================
2010-11-20 10:32
快速回复:【求助】乘法表的显示效果不满意,请帮忙优化!
数据加载中...
 
   



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

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