1樓:匿名使用者
這個很簡單的了
就是兩個變數,分別的for迴圈,
**很簡單的。
部分**:
請新建乙個工程,然後在窗體**中,加入以下**,執行後,點選視窗,就會出現執行結果。
private sub form_click()
autoredraw = true '讓視窗自動重繪,以免擋住了就看不見了
cls '清除窗體的內容 width = 9000 '以免視窗太小
height = 6000
dim i as integer, j as integer
for i = 1 to 9
for j = 1 to i
print vbtab & i & "×" & j & "=" & (i * j); '輸出,用上分號是不讓這一行馬上就結束了,不然就會看不到梯度了
next print '結束這一行
next
end sub
具體
2樓:匿名使用者
sub 九九乘法()
dim x&, y&, i&
dim arr(1 to 9, 1 to 9)for x = 1 to 9
for y = 1 to 9
if x <= y then
arr(y, x) = y & "×" & x & "=" & x * y
end if
next y
next x
end sub
3樓:匿名使用者
private sub form_click()dim h as string
dim a as integer
dim b as integer
for a = 1 to 9
h = ""
for b = 1 to 9
h = h & a & "*" & b & "=" & a * b & vbtab
next b
print h
next a
end sub
4樓:匿名使用者
private sub form_activate()for i = 1 to 9
for j = 1 to 9
print j & "*" & i & "=" & j * i,next j
next i
end sub
用vb程式怎麼做九九乘法表?
5樓:匿名使用者
用vb程式怎麼做九九乘法表的步驟如下:
建立顯示結果的窗體:
編寫按鈕巨集
private sub command1_click()dim a, b as integer
dim s as string: s = ""
for a = 1 to 9
for b = 2 to 9
s = s & a & "*" & b & "=" & b * aif b <> 9 then s = s & space(1) else s = s & vbnewline
next
next
msgbox s
end sub
3.執行結果
6樓:匿名使用者
直接兩個for迴圈就可以了.給你的例子看下:private sub form_click() '對form窗體的單擊事件新增**
for i = 1 to 9 step 1for j = 1 to i
print j & "x" & i & "=" & i * j; vbtab;
next j
next i
end sub 效果圖:
7樓:匿名使用者
private sub form_click()dim a as integer
dim b as integer
dim s as string
for a = 1 to 9
for b = 1 to a
s = s & b & "×" & a & "=" & a * b & " "
next
print s
s = ""
next
end sub **很直觀,無須解釋。
8樓:匿名使用者
private sub form_click()dim a, b, c as stringfor a = 1 to 9
for b = 1 to a
c = c & b & "×" & a & "=" & a * b & " "
next
print c
c = ""
next
end sub
9樓:匿名使用者
private sub command1_click()dim a, b, c as integerfor a = 1 to 9
for b = 1 to a
c = a * b
print b & "x" & a & "=" & c; vbtab;
next
next
end sub
10樓:匿名使用者
private sub command2_click()for i = 1 to 9 step 1for j = 1 to i
print j & "*" & i & "=" & i * j; vbtab;
next j
next iend sub
vb程式設計:九九乘法表
11樓:秋色烽火
private sub form_click()dim a
for i = 1 to 9
for j = 1 to i
a = a & cstr(i * j) & " "
next
print a
a = ""
next
end sub
12樓:vb妮可
private sub form_click()for i = 1 to 9
for j = 1 to i
print i * j;
next
next
end sub
vb程式設計 九九乘法表 右下三角形
13樓:匿名使用者
private sub command1_click()me.fontsize = 30'字型大小 30有點大,超出視窗範圍了
dim i as integer
dim j as integer
dim s as string
for i = 1 to 9
for j = 1 to i
s = cstr(i) & "*" & cstr(j) & "=" & cstr(i * j)
s = s & space$(10 - len(s))print s;
next j
next i
end sub
14樓:匿名使用者
private sub form_click()fontsize = 30
b = " 九九乘法表": print bfor i = 1 to 9
for j = 1 to i
a = cstr(j) & "*" & cstr(i) & "=" & cstr(j * i) & " "
print a;
if i = j then print
next j
next i
end sub
在vb裡輸出九九乘法表
15樓:四捨**入
private sub form_click()for a = 1 to 9
for b = 1 to a
print b; "*"; a; "="; b * a;
next b
next a
end sub
16樓:匿名使用者
private sub form_click()for a = 1 to 9
for b = 1 to a
print b; "*"; a; "="; b * a;
next b
next a
end sub
17樓:
private sub command1_click()dim i, j, s
for i = 1 to 9
for j = 1 to i
s = s & j & "×" & i & "=" & iif(len(i * j) < 2, i * j & " ", i * j) & " "
next
s = s & vbcrlf
next
print s
end sub
我們vb程式老師讓我們程式設計九九乘法表,要求在窗體上輸出表。求程式啊
18樓:匿名使用者
'點選窗體出現九九乘法表,如果顯示不全,適當調大窗體private sub form_click()dim a as integer
dim b as integer
dim c as string
for a = 1 to 9
c = ""
for b = 1 to 9
c = c & a & "×" & b & "=" & a * b & vbtab
next b
print c
next a
end sub
19樓:匿名使用者
dim a as integer
dim b as integer
for a = 1 to 9
for b = 1 to a
print cstr(b) & "*" & cstr(a) & "=" & cstr(a * b); spc(2);
next b
next a
20樓:匿名使用者
private sub command1_click()dim a as integer
dim b as integer
for a = 1 to 9
for b = 1 to a
print b & "*" & a & "=" & a * b & " ";
next b
next a
end sub
vb九九乘法表左上三角形怎麼程式設計
21樓:匿名使用者
兩個for迴圈
int i,j;
for(i=1;i<=9;i++)
*=\t",i,j,i*j)
}console.writeline();
}....這是c#的 ,反正就兩次迴圈,外面的for迴圈控制行, 裡面巢狀的for迴圈控制列
22樓:會飛滴包子
在按鈕的單擊事件裡寫
for i = 1 to 9
for j = 1 to (10 - i)if (i * j) > 9 then
print i & " * " & j & " = " & i * j & " ";
else
print i & " * " & j & " = " & i * j & " ";
end if
next j
next i
標準三角,不因為算式長短而錯位
利用vb語言程式設計:輸出九九乘法表
vb程式設計九九乘法表編寫,求高手解答,非常感謝!
VB九九乘法表,在VB裡輸出九九乘法表
print string 56,56個 print tab 25 九九乘法表 25個跳格鍵tab之後,列印 九九乘法表 print string 56,for i 0 to 9 print tab i 6 i 每隔6個跳格鍵tab,列印i。如i 0時,在開始位置列印0 i 1時,從開始位置算起的6個...
乘法九九表的秘密是什麼,隱藏在九九乘法表裡的小秘密是什麼?
九九乘法歌訣 又常稱為 小九九 現在學生學的 小九九 口訣,是從 一一得一 開始,到 九九八十一 止,而在古代,卻是倒過來,從 九九八十一 起,到 二二得四 止。因為口訣開頭兩個字是 九九 所以,人們就把它簡稱為 九九 大約到13 14世紀的時候才倒過來像現在這樣 一一得一 九九八十一 中國使用 九...
利用python輸出倒置排列的九九乘法表
for ii in range 9,0,1 for jj in range 9,0,1 if jj ii print format ii,jj,str ii jj rjust 2,print 結果為 e69da5e6ba9062616964757a686964616f31333337383863 9...