vb程式設計問題

2022-06-06 07:50:12 字數 786 閱讀 7587

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程式設計問題

此方法是用隨機數產生20個不重複的數,顯示20個數,再挑出奇數,再排列,再顯示。數字之間用空格隔開。private sub command1 click text1 text2 dim a 1 to 20 b 1 to 20 as integer dim i,i1,i2,j,j1,j2,j3,j4,...

VB程式設計問題請教

if then語句有行語句和塊語句.你這樣寫,第2個if a1 375 then a2 0.571 是行語句 你看給你整理下.private sub command5 click if a1 0 and a1 1000 then if a1 375 then a2 0.571 elseif a1 4...

vb6 0程式設計問題,求解答

w.paintpicture pic.picture,i,j,pic.scalewidth,pic.scaleheight pic.scalewidth pic.scaleheight 對嗎?nexy j next拼寫錯誤 for j 0 to w.height step pic.scaleheig...