ywtl.net
当前位置:首页>>关于vb编写程序 乘法口诀的资料>>

vb编写程序 乘法口诀

直接两个for循环就可以了.给你的例子看下:Private Sub Form_Click() '对form窗体的单击事件添加代码 For i = 1 To 9 Step 1 For j = 1 To i Print j & "X" & i & "=" & i * j; vbTab; Next j Print Next i End Sub 效果图:

Private Sub Command1_Click() Dim i As Integer, j As Integer For i = 1 To 9 For j = 1 To i Print i; "*"; j; "="; i * j; Next Print Next End Sub

Private Sub Form_click() For e = 1 To 9 Print Tab(10 * e - 1); e; Next e For i = 1 To 9 Print Tab(1); Print i For j = 1 To i s = i * j k = i & "*" & j & "=" & s Print Tab(10 * j); k; Next j Print Next i End Sub

Private Sub Command1_Click() Dim i As Integer Dim j As Integer For i = 1 To 9 Step 1 Print " "; For j = 1 To 9 Print i * j; Print vbTab; Next j Print vbTab Next i End Sub Private Sub Form_Load() Command1.Caption = "Display(&D)"...

Private Sub Command1_Click() Dim i, c, j As Long: Dim printStr As String j = 1 For i = j To 9 For c = 1 To j printStr = printStr & c & "×" & i & "=" & i * c & ";" Next printStr = printStr & vbCrLf If j < 4 Then j = j + 1 Next P...

Private Sub Command1_Click() Dim i, c, j As Long: Dim printStr As String j = 1 For i = j To 9 For c = 1 To j printStr = printStr & c & "×" & i & "=" & i * c & ";" Next printStr = printStr & vbCrLf If j < 4 Then j = j + 1 Next P...

'直角三角形的形式 Dim i As Integer, j As Integer, se As String For i = 1 To 9 For j = 1 To i se = i & "×" & j & "=" & i * j Print Tab((j - 1) * 9 + 1); se; Next j Print Next i '矩形的形式 Dim i As Integer, j As Integer, se As S...

对 积 是

Private Sub Command1_Click()Dim i As Integer, j As Integer, s As StringFor i = 1 To 9 For j = 1 To i s = " " & i & "x" & j & "=" & i * j & String(5, " ") If j > 1 And i * j < 10 Then s = s + String(1, " ") Label1.Caption = Labe...

(1)print"*" 意思是打印一个字符"*"。 (2)print:print VB中,一行一句命令,如果你想多句命令一行,可用冒号隔开。 print省略参数就表示输出一个空行。 简单说,"print:print"就等于: print print 打印两行空行。 (3)tab(n)函数。 用来将光标移...

网站首页 | 网站地图
All rights reserved Powered by www.ywtl.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com