vb程式設計問題

時間 2022-05-18 07:05:04

1樓:

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

2樓:匿名使用者

private sub command1_click()dim sum as double, k as doubledim i as integer, j as integerk = 1

for i = 1 to 100

for j = i to 2 step -1k = k * j

next

sum = sum + k

k = 1

next

msgbox sum

end sub

3樓:匿名使用者

private sub form1_activateddim s as integer,p as integerfor i=1 to 100

p=1for j=1 to i

p=p*i

next j

s=s+p

next i

print "1!+2!+......+100!=";send sub

vb 程式設計問題

看一下rnd函式的用法。rnd 函式。返回乙個包含隨機數值的 single。語法rnd number 可選的 number 引數是 single 或任何有效的數值表示式。返回值如果 number 的值是 rnd 生成小於 0 每次都使用 number 作為隨機數種子得到的相同結果。大於 0 序列中的...

vb程式設計,vb程式設計

介面設計如下 試編寫 如下 private sub updatestat if list1.listcount 1 thencommand1.enabled falsecommand2.enabled falseelse command1.enabled truecommand2.enabled t...

VB程式設計,vb程式設計是什麼?

完成的程式 dim h as integer,m as integer,s as integer private sub form load label1.fontsize 48 h hour time m minute time s second time timer1.interval 1000...