用vb编写九九乘法表右上角表示(急)

soul0rain 2009-04-16 12:48:10
今天我们学了九九乘法表的编写,但是老师留给了一课后题我们思考。九九表的右上角的表示:
1*1=1
2*1=2 2*2=4
3*1=3 3*2=6 3*3=9
4*1=4 4*2=8 4*3=12 4*4=16
............
9*1=9 9*2=18 9*3=27 9*4=36 9*5=45 9*6=54 9*7=63 9*8=72 9*9=81
那位能想出来,在此谢过了。我要详细的解析(我是新手的)

...全文
1864 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
soul0rain 2009-04-17
  • 打赏
  • 举报
回复
Sub printstr(Inputstr As String)
Print String(62 - Len(Inputstr), " ") & Inputstr
End Sub

这里不会
还有为什么要用cache = "" 和
cache = cache & " " & i & "*" & j & "=" & i * j
cache有什么作用?
我刚开始学
很多都不懂,希望各位耐心指导。
  • 打赏
  • 举报
回复
~~
嗷嗷叫的老马 2009-04-16
  • 打赏
  • 举报
回复
....................................................
xrongzhen 2009-04-16
  • 打赏
  • 举报
回复

Sub printstr(Inputstr As String)
'Print String(62 - Len(Inputstr), " ") & Inputstr
Print Space(62 - Len(Inputstr)) & Inputstr '就是前面加空格
End Sub

Private Sub Form_Click()
Dim i As Integer, j As Integer
Dim cache As String
For i = 1 To 9
cache = ""
For j = 1 To i
cache = cache & " " & i & "*" & j & "=" & i * j
Next j
printstr cache
Next i


这代码的格式在修改一下,没对齐
nigelyoyo 2009-04-16
  • 打赏
  • 举报
回复
问题是这段代码你哪里不懂撒?
soul0rain 2009-04-16
  • 打赏
  • 举报
回复
我得到一段代码能解决的但是不懂什么意思也?
谁能帮我解析一下
Sub printstr(Inputstr As String)
Print String(62 - Len(Inputstr), " ") & Inputstr
End Sub

Private Sub Form_Click()
Dim i As Integer, j As Integer
Dim cache As String
For i = 1 To 9
cache = ""
For j = 1 To i
cache = cache & " " & i & "*" & j & "=" & i * j
Next j
printstr cache
Next i


End Sub

7,762

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧