1樓:
private sub form_click()for i = 1 to 9
for j = 1 to i
print j; "*"; i; "="; i * j;
if j = 2 and (i = 3 or i = 4) thenprint " ";
end if
next j
next i
end sub
2樓:玲清音
我下面給你的這個**是包括正三角列印乘法表和倒三角列印的……
private sub ***mand1_click()
dim se as string
print tab(35); "九九乘法表"
print tab(35); "-----------"
for i = 1 to 9
for j = 1 to i
se = i & "×" & j & "=" & i * j 'se字串變數存放每一項表示式
print tab((j - 1) * 9 + 1); se; ' 每項表示式顯示佔9列
next j
print '換行
next i
end sub
private sub ***mand2_click()
dim se as string
print tab(35); "九九乘法表"
print tab(35); "-----------"
for i = 1 to 9
for j = i to 9
se = i & "×" & j & "=" & i * j 'se字串變數存放每一項表示式
print tab((j - 1) * 9 + 1); se; ' 每項表示式顯示佔9列
next j
print '換行
next i
end sub
private sub ***mand3_click()
me.cls
end sub
vb,編寫程式,將九九乘法表寫入到c99.txt資料夾中
3樓:匿名使用者
主要程式:
dim i, j as int16
i = 1
dim s as string
for i = 1 to 9
for j = 1 to i
s &= j.tostring & "x" & i.tostring & "=" & i * j & " "
next
s &= vbcrlf
next
然後把s變數寫入到檔案c99.txt就是了。如果你用vb6,那麼.tostring就不要寫了。
4樓:巨星李小龍
private sub form_load()open "c:\users\asus\desktop\c99.txt" for output as #1
for i = 1 to 9
for j = 1 to 9
print #1, j & "*"; i & "=" & i * j,
next
print #1,
next
close #1
end sub
執行沒問題,望採納……
VB程式設計題目,vb程式設計題目
private sub command1 click dim k sum sum 0 k val trim inputbox 請輸入正整數k的值 for i 1 to len str k sum sum val mid str k i,1 next i msgbox sum end subpriva...
VB程式設計問題,VB程式設計中的迴圈問題
有個 自己去看吧,都是考試的。編一個求圓周長的程式。輸入半徑,得到周長和麵積。試試看。建議你不要光學vb,畢竟它有太多缺點,很多事做不了 如果是對basic語言感興趣的話,到不如去學哈freebasic,powerbasic,purebasic,它們都功能超級強大 freebasic甚至可以寫作業系...
vb程式設計問題
private sub command1 click dim i,j as integer,s as double,n as double for i 1 to 100 n 1 for j 1 to i n n j next j s s n next i print 1 2 100 send sub...