怎麼用vb編出九九乘法表如下圖,用VB程式怎麼做九九乘法表?

2022-03-05 16:07:00 字數 5001 閱讀 3951

1樓:陳列專家

private sub form_load()me.autoredraw = true

dim i, j as integer

dim sdisp as string

for i = 1 to 9

for j = 1 to 9

if i >= j then

sdisp = sdisp & j & "x" & i & "=" & i * j & iif(i * j > 9, " | ", "  | ")

end if

next j

sdisp = sdisp + vbcrlfnext i

print sdisp

end sub

2樓:匿名使用者

option explicit

private sub form_load()

me.autoredraw = true

dim i as long, j as long, x as long

for i = 1 to 9

for j = 1 to i

me.print i & " x " & j & " = " & iif(i * j < 10, " ", "") & i * j & iif(j = 9, "", " | ");

next

if i < 9 then

if x = 0 then x = me.currentx * 9 + 216

me.print

me.print

me.line (me.currentx, me.currenty)-(x, me.currenty)

me.print

end if

next

end sub

用vb程式怎麼做九九乘法表?

3樓:匿名使用者

用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.執行結果

4樓:匿名使用者

直接兩個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

print

next i

end sub 效果圖:

5樓:匿名使用者

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 **很直觀,無須解釋。

6樓:匿名使用者

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

7樓:匿名使用者

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

print

next

end sub

8樓:匿名使用者

private sub command2_click()for i = 1 to 9 step 1for j = 1 to i

print j & "*" & i & "=" & i * j; vbtab;

next j

print

next iend sub

怎樣用vb編寫列印九九乘法表

9樓:四舍**入

按鈕單擊**

private sub command1_click()for i = 1 to 9

for j = 1 to i

print i & "*" & j & "=" & i * j & " ";

next j

print

next i

end sub

10樓:匿名使用者

按鈕單擊**

private sub command1_click()for i = 1 to 9

for j = 1 to i

print i & "*" & j & "=" & i * j & " ";

next j

print

next i

end sub效果

vb程式設計 九九乘法表 右下三角形

11樓:匿名使用者

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

print

next i

end sub

12樓:匿名使用者

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程式設計九九乘法表

13樓:網海1書生

(1) 9

(2) j & "*" & i & "=" & j * i;

(3) print

14樓:匿名使用者

private sub command1_click()dim i as integer

dim j as integer

for i = 1 to 9 step 1print " ";

for j = 1 to i

print i*j

print vbtab;

next j

print

next i

end sub

15樓:匿名使用者

沒圖啊,大概這樣

dim i as integer

dim j as integer

for i = 1 to 9 step 1print " ";

for j = 1 to 9

print i & "*" & j & "=" & i * jprint vbtab;

next j

print vbcrlf

next i

16樓:匿名使用者

(1)填9

(2)填i*j;

(3)填print

用vb編一個左下三角的九九乘法表

17樓:紅一世界的白

private sub command1_click()form1.cls

print "*";

for i = 1 to 9

print tab(i * 6); i;

next i

print

for j = 1 to 9

print j; "";

for i = 1 to j

print tab(i * 6); j * i; "";

next i

print

next j

end sub

18樓:少公羽

private sub command1_click()for i = 1 to 9

for j = 1 to i

print j; "*"; i; "="; i * j;

next j

print

next i

end sub

用VB實現答應三角九九乘法表

上三角九九乘法表 private sub form click dim i as integer,j as integerfor i 1 to 9 for j 1 to 9 if i j then se i x j i jprint tab j 1 9 1 se end if next j prin...

用Python怎樣實現九九乘法表

哈哈 看見你這個我就想起了 開啟鉛筆盒偷偷看。然後 隨便寫一寫 from prettytable import prettytable pt prettytable pt.field names i for i in range 1,10 mulp x format a a,b b,c a b if...

用EXCEL怎麼做九九乘法表,怎麼用excel表格做九九乘法表

回答如下 excel的計算功能是非常強大的,無論什麼計算只要輸入後即可計算出結果。你說的是乘法計算,你只要將excel開啟 這就是一個計算器了 比方說你要計算236.36 2513.03,你可以 在任何一個單格內點一下 比方說是a1 然後在上面點一下 在a1單格內會出現 sum 然後你在括號中寫入 ...