VB程式設計這題有人會嗎幫忙下謝謝!!好的就直接採納了

2022-03-09 01:44:27 字數 5097 閱讀 5347

1樓:

對應a(i,j)的值怎麼求你找公式,要在文字框列印陣列其實是利用的空格和換行符,例如:chr(32) 空格 chr(10) 換行,更多可查詢ascii對應表。你可以輸出後面接第二行的表示式即可。

望採納!

2樓:匿名使用者

dim a(1 to 5, 1 to 4) as integer, b(1 to 5, 1 to 4) as integer, c(1 to 5, 1 to 4) as integer

private sub command1_click()

text3.text = ""

for i = 1 to 5

for j = 1 to 4

c(i, j) = a(i, j) + b(i, j)

next j

next i

for i = 1 to 5

for j = 1 to 4

text3.text = text3.text & space(3) & c(i, j)

next j

text3.text = text3.text & vbcrlf

next i

end sub

private sub command2_click()

endend sub

private sub form_load()

text1.text = "": text2.text = "": text3.text = ""

for i = 1 to 5

for j = 1 to 4

randomize

a(i, j) = int(rnd * 10)

next j

next i

for i = 1 to 5

for j = 1 to 4

randomize

b(i, j) = int(rnd * 10)

next j

next i

for i = 1 to 5

for j = 1 to 4

text1.text = text1.text & space(3) & a(i, j)

text2.text = text2.text & space(3) & b(i, j)

next j

text1.text = text1.text & vbcrlf

text2.text = text2.text & vbcrlf

next i

end sub

很簡單的喲。

vb的這題程式程式設計有人會嗎,幫忙下謝謝,好的就直接採納了! 有會的麻煩回答下感激不盡!!都沒人嗎??

3樓:匿名使用者

執行效果見圖:

**如下:

option explicit

private sub command1_click()dim g as integer

dim s as integer

dim g1 as integer, g2 as integerdim s1 as integer, s2 as integerdim b1 as integer, b2 as integerdim pfs1 as integer, pfs2 as integer

me.cls

for s = 1 to 9

for g = 0 to 9

if s < g then

pfs1 = (s * 10 + g) ^ 2pfs2 = (g * 10 + s) ^ 2g1 = pfs1 mod 10

s1 = pfs1 \ 10 mod 10b1 = pfs1 \ 100

g2 = pfs2 mod 10

s2 = pfs2 \ 10 mod 10b2 = pfs2 \ 100

if g1 = b2 and s1 = s2 and b1 = g2 then

print s * 10 + g; "^2="; pfs1, g * 10 + s; "^2="; pfs2

end if

end if

next g

next s

end sub

vb的這題有人會嗎?幫幫忙要步驟謝謝!好的直接採納不廢話!

4樓:匿名使用者

private sub form_load()dim i%

for i = 0 to 6

label1(i).forecolor = rgb(255, 0, 0)

label1(i).fontsize = 17next i

timer1.enabled = trueend sub

private sub timer1_timer()static n%

dim i%

if n > 6 then'判斷是否達到要求n = 0'累加清空

for i = 0 to 6

label1(i).visible = false'全部可見變為假next i

end if

label1(n).visible = truen = n + 1

end sub

應該是這樣的**,然後為了更好的表現效果,我在全部顯示完之後加了重新開始的迴圈,如果不需要的話可以刪掉。

vb這題要怎麼做幫幫忙謝謝,最好有步驟,好的直接採納!急求!

5樓:匿名使用者

定義一個全域性變數的陣列:

dim a(10) as integer

隨機產生10個兩位的素數,素數各不相同:

dim a(10), x as integerdim str as string = ""

dim di as boolean = truedim n as integer

dim sd as

for i = 1 to 10

dodo

randomize()

n = int(rnd() * 100 + 10)loop until issushu(n)if i > 1 then

for x = 1 to i - 1

if a(x) = n then

di = false

end if

next

end if

loop until di = true

a(i) = n

'str = str & a(i) & " "

next

隨機數升序排序:

for i = 1 to 10

for j = 1 to 10 - i

if a(j) > a(j + 1) thenx = a(j + 1)

a(j + 1) = a(j)

a(j) = x

end if

next j

next i

for i = 1 to 10

str = str & a(i) & " "

next

將升序的陣列寫入檔案:

dim file as new system.io.streamwriter("data1.txt")

file.writeline(str)

file.close()

讀取檔案,並寫入陣列及降序排序:

dim file as new system.io.streamreader("data1.txt")

dim words as string = file.readtoend()

file.close()

dim b() as string

dim temp as integer

dim str1 as string

str1 = ""

b = split(words, " ")dim c() as integer

dim l as integer

l = ubound(b)

redim c(l)

for i = 1 to l

c(i) = val(b(i - 1))

next

for i = 1 to l

for j = 1 to l - i

if c(j) < c(j + 1) thentemp = c(j + 1)

c(j + 1) = c(j)

c(j) = temp

end if

next j

next i

for i = 1 to l

str1 = str1 & c(i) & " "

next

msgbox(str1)

6樓:數學與計算機程式設計

**:dim t as date, k as integerprivate sub form_load()timer1.interval = 1000timer1.

enabled = truetimer2.interval = 0

timer2.enabled = falseend sub

private sub text1_keypress(keyascii as integer)

if keyascii = 13 thentimer2.interval = 500timer2.enabled = truet = cdate(text1.text)end if

end sub

private sub timer1_timer()label1.caption = timeend sub

private sub timer2_timer()k = k + 1

if k > 9 then k = 0

if time >= t then

if k mod 2 = 0 then

label1.backcolor = vbredelse

label1.backcolor = vbwhiteend if

end if

end sub

執行效果:

vb程式設計題,有人會做麼?要詳細的程式設計步驟!謝謝!!

求解下面這三道程式設計題vb謝謝,急求!一道VB程式設計題 謝謝!

程式設計題1 option explicit private sub form load dim strinput as stringdim bytidx as byte dim strrank 1 to 3 as stringdim sngnum as singlestrrank 1 st str...

會解釋下列古詩嗎?急用,謝謝,請幫忙解釋一下這首詩,謝謝

春夜喜雨 杜甫好雨知時節,當春乃發生。隨風潛入夜,潤物細無聲。野徑雲俱黑,江船火獨明。曉看紅溼處,花重錦官城。詩文解釋 好雨知道下雨的節氣,正是在植物萌發生長的時侯,它隨著春風在夜裡悄悄地落下,悄然無聲地滋潤著大地萬物。雨夜中野外黑茫茫,只有江船上的燈火格外明亮。天亮後,看看這帶著雨水的花朵,嬌美紅...

麻煩幫忙計算一下這道題,謝謝不定積分麻煩會的幫忙看一下這道題用第二換元法計算謝謝

解 因為總的良品率為93 達不到95 那麼就不可能每個月都能領到獎金了,最多有2個月能領到獎金。所以能賺到最多錢的情況是 前2個月每個月都生產了950件,且良品率為100 95 或者100 都可以,儘量把不合格的都放到第3個月,反正第3個月是沒獎金的,不影響我們計算 那麼3個月總加工的產品數為 27...