用VB制作一个9*9表,输出方式为,正直三角和倒三角,可以拼在一起,组合成矩形。 5
我有正三角的代码:大家补充一下啊:邮箱634334204@qq.com,要正确的程序。用Command显示:谢谢了fori=1to9forj=1to9se=i&"x"&j...
我有正三角的代码:大家补充一下啊:邮箱634334204@qq.com,要正确的程序。用Command 显示:谢谢了
for i=1 to 9
for j=1 to 9
se=i& "x"& j &"=" &i*j
picture1.print tab((j-1)*9+1); se;
next j
picture1.print
next i 展开
for i=1 to 9
for j=1 to 9
se=i& "x"& j &"=" &i*j
picture1.print tab((j-1)*9+1); se;
next j
picture1.print
next i 展开
1个回答
展开全部
Private Sub Command1_Click()
Dim i As Integer, j As Integer, x As String
Form1.AutoRedraw = True
For i = 1 To 9
For j = 1 To i
x = j & "×" & i & "=" & i * j
Form1.Print x; Space(7 - Len(x));
Next j
Form1.Print
Next i
End Sub
Private Sub Command2_Click()
Dim i As Integer, j As Integer, x As String
Form1.AutoRedraw = True
Dim bk As String
For j = 1 To 9
For i = j To 9
bk = i & "x" & j & "=" & i * j
Print bk;
Print vbTab;
Next i
Print
For i = 0 To j - 1
Print vbTab;
Next i
Next j
End Sub
Dim i As Integer, j As Integer, x As String
Form1.AutoRedraw = True
For i = 1 To 9
For j = 1 To i
x = j & "×" & i & "=" & i * j
Form1.Print x; Space(7 - Len(x));
Next j
Form1.Print
Next i
End Sub
Private Sub Command2_Click()
Dim i As Integer, j As Integer, x As String
Form1.AutoRedraw = True
Dim bk As String
For j = 1 To 9
For i = j To 9
bk = i & "x" & j & "=" & i * j
Print bk;
Print vbTab;
Next i
For i = 0 To j - 1
Print vbTab;
Next i
Next j
End Sub
追问
不对,我的意思是一个正倒一个,合在一起的,
追答
同一行既要输出正三角的内容又要输出倒三角的内容,怎么可能控制得了实现呢。也没见过这种作业和需求,要么你就用两个Label分别输出上下三角,然后叠加显示成矩形。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询