1樓:匿名使用者
三角形的九九乘法表
private sub form_load()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
msgbox s
end sub
2樓:請教再請教
private sub 確定_click()dim i as integer
dim j as integer
dim str as string
me.autoredraw = true
for i = 1 to 9
str = ""
for j = 1 to 9
str = str & i & "×" & j & " = "
str = str & i * j
str = str & vbtab
next j
print str
next i
end sub
3樓:
private sub form_click()dim i as integer, j as integer, k as integer
me.autoredraw = true
print tab(30); "九九乘法表"
print "*" & vbtab;
for i = 1 to 9
print cstr(i) & vbtab;
next
for j = 1 to 9
print cstr(j) & vbtab;
for k = 1 to j
print cstr(j * k) & vbtab;
next
next
end sub
4樓:匿名使用者
private sub form_load()dim i as integer, j as integer, k as integer
me.autoredraw = true
print tab(30); "九九乘法表"
for i = 1 to 9
next
for j = 1 to 9
for k = 1 to j
print cstr(j * k) & vbtab;
next
next
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 command1_click()for i = 1 to 9
for j = 1 to i
print i & "*" & j & "=" & i * j & " ";
next j
next i
end sub
12樓:匿名使用者
按鈕單擊**
private sub command1_click()for i = 1 to 9
for j = 1 to i
print i & "*" & j & "=" & i * j & " ";
next j
next i
end sub效果
在vb裡輸出九九乘法表
13樓:四捨**入
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
14樓:匿名使用者
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
15樓:
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 九九乘法表
16樓:板渡
(1)print"*"
意思是列印乙個字元"*"。
(2)print:print
vb中,一行一句命令,如果你想多句命令一行,可用冒號隔開。
print省略引數就表示輸出乙個空行。
簡單說,"print:print"就等於:
列印兩行空行。
(3)tab(n)函式。
用來將游標移到引數n指定的位置開始輸出資訊。tab(i*6),(i=1,2,3...),也就是在第6、12、24...
格才輸出表示式,這樣看起來就像乙個列表一樣。如果你需要更要寬鬆一點,你寫成tab(i*7)也是可以的:)
樓主提供的程式**,語句有點混亂,執行也不正確.
請參考我提供的以下的乘法表(思路清晰):
private sub form_click()print tab(35); "乘法表"
dim se as string
for i = 1 to 9
for j = 1 to i
se = i & "x" & j & "=" & i * jprint tab((j - 1) * 9); se;
next j
next i
end sub
17樓:茂煙
for i = 1 to 9
for k=0 to 9-j
'先輸出一系列空格字元
text1.text =text1.text & space(9)next k
for j = i to 1 step -1'逆序輸出m=a*b 的形式
'用format函式定寬輸出
text1.text =text1.text & format(i * j,"##")+ "=" & format(i,"##") + "*" + format(j,"##")&" "
next j
for j = 1 to i
'順序輸出a*b=m形式
'同樣用format固定數字寬度
text1.text = text1.text & format(i,"##") & "*" & format(j,"##") & "=" & format(i * j,"##") &" "
next j
text1.text = text1.text + vba.vbcrlf
next i
18樓:匿名使用者
**給你,其它背景字型什麼的都是小問題
private sub command1_click()dim i as integer,j as integer
for i = 1 to 9for j = 1 to iprint j & "x " & i & "= " & i * j & vbtab;
next
next
end sub
19樓:
private sub command1_click()'text1.scrollbars = 1'設計時設定dim i as integer
dim t as variant
dim j as integer
text1.text = ""
for i = 1 to 9
for j = 1 to 9 - i
text1.text = text1.text & vbtabnext j
for j = i to 1 step -1text1.text = text1.text & cstr(i * j) & "=" & cstr(i) & "*" & cstr(j) & vbtab
next j
for j = 1 to i
text1.text = text1.text & cstr(j) & "*" & cstr(i) & "=" & cstr(i * j) & vbtab
next j
text1.text = text1.text + vbcrlfnext i
end sub
VB中的timer怎麼用,vb中timer怎麼用
去圖書館借本書去看吧,這是個很簡單的知識 關鍵是設定timer interval 屬性,1000代表1秒,同理,500代表半秒 設定屬性可以在屬性視窗設定也可以在 中設定timer1.interval 500 然後就是可用和不可用了 timer1.enabled true 你把timer1.inte...
怎麼用VB設計登陸介面,怎麼用VB設計乙個登陸介面?
1.首先新增2個label控制項,乙個caption為使用者名稱,乙個為密碼然後分別在2個label控制項後面新增乙個text控制項,2.將text的text屬性設定為空再新增2個button按鈕,乙個名為登陸,乙個名為取消簡要 如下 private sub text2 change sswordc...
怎麼用vb畫逐漸生成的圓,怎麼用vb畫乙個逐漸生成的圓
你好,從你的描述來看,不用過於擔心,建議一周後複查b超看看胎兒的發育情況。病情分析 正常情況下孕5周左右b超可見宮腔內孕囊。從b超結果看,宮腔內的液性暗區暫時不能確定就是孕囊。指導意見 建議暫觀察,注意休息,避免性生活和劇烈運動,一周後複查b超,若可見卵黃囊和胚芽,則可確定是宮內妊娠。在vb中怎麼用...
vb中的randomize怎麼用
dim ret as integer randomize ret rnd max min 1 rnd 函式 返回乙個包含隨機數值的 single。語法rnd number 可選的 number 引數是 single 或任何有效的數值表示式。返回值如果 number 的值是 rnd 生成 小於 0 每...
VB裡for next這個怎麼用
1 首先要了解for next語句的基本語法結構,其語句的基本結構是for 變數 初值 to終值 step 步長值,其中像for next step是vb中保留字,變數應該符合vb中命名規範,步長值根據自己的需要進行設定。2 for後面的變數應該滿足vb中命名原則,變數的開頭必須是漢字或者是字母開頭...