VB作業會的進

時間 2022-03-28 03:05:20

1樓:匿名使用者

private sub command1_click()

dim a as variant, max as integer, min as integer

a = array(89, 96, 81, 67, 79, 90, 63, 85, 95, 83)

max = 0

min = 100

for i = 0 to ubound(a)

if max <= val(a(i)) then max = a(i)

if min >= val(a(i)) then min = a(i)

next

label1.caption = "最大值:" & max & " 最小值:" & min

end sub

2樓:匿名使用者

private sub command1_click()a = array(89, 96, 81, 67, 79, 90, 63, 85, 95, 83)

max = a(0): min = a(0)for i = 0 to 9

if max < a(i) then max = a(i)if min > a(i) then min = a(i)next i

label1.caption = "max=" & maxlabel2.caption = "min=" & minend sub

3樓:匿名使用者

我給你關鍵**

dim num(10) as long

num(1)=89

num(2)=96

...num(10)=83

dim max as long,min as longmax=num(1)

min=num(1)

for i=1 to 10

if num(i)>max then max=num(i)if num(i)

print max,min

4樓:

dim a as variant

b = text1.text

a = split(b, ",")

max = 0

min = 1000000

for i = 0 to ubound(a) - 1if a(i) > max then

max = a(i)

end if

if int(a(i)) < int(min) thenmin = a(i)

end if

next i

print "最大數:"; max

print "最大數:"; min

求簡單的VB作業,求用VB解答

題目都沒有,如何寫,瞎寫嗎?寫 x y z 嗎?dim b as integer private sub command1 click if 123456 falseprint hello falseelsemsgbox 密碼錯誤 1 b b 1 if b 3 then msgbox 你沒有機會了 ...

vb高手進,vb連線mysql資料庫,怎麼把資料寫入資料庫

蹇永芬壬辰 必須安裝mysql的驅動才行,不管是vb還是c 都需要這個驅動。如下 public function exemysql byval sqlas string asadodb.recordset sql trim sql setconn new adodb.connection setrs...

vb傳送十六進位制串列埠資料,VB 傳送十六進位制串列埠資料

private sub command1 click dim sj as string dim sjbyt as byte dim i as long next i mscomm1.output sjbytend sub private sub form load text1 30h 30h 5fh...