一道很簡單的vb程式設計題,一道很簡單的VB程式設計題

2022-02-01 04:30:59 字數 803 閱讀 9155

1樓:

private function c(n as integer, k as integer) as long

c = f(n) / f(k) / f(n - k)end function

private function f(i as integer) as long

f = 1

for j = 2 to i

f = f * j

next j

end function

private sub command1_click()dim n as integer, k as integern = 10 'n大於12會出錯的!

k = 3

print c(n, k)

end sub

2樓:匿名使用者

private function c(n as double, k as double) as double

c = f(n) / f(k) / f(n - k)end function

private function f(i as double) as double

f = 1

for j = 2 to i

f = f * j

next j

end function

private sub command1_click()dim n as double, k as doublen = 10 '這樣改會好一點

k = 3

print c(n, k)

end sub

一道VB程式設計題目,求大佬解答,一道vb程式設計題目求大佬解答!!!

private sub mand1 click dim i as integer for i 11 to 999 if i strreverse i and i 2 strreverse i 2 and i 3 strreverse i 3 then print i,i 2,i 3end if ne...

一道c語言程式設計題,一道C語言程式設計題。

include delete all n in array a void fun int a,int n,int odd,int even int main void int odd,even fun a,6,odd,even printf d d n odd,even return 0 void ...

很簡單的一道求橢圓方程題

解 因為橢圓c y a x b 1 a b 0 的右頂點為a 1,0 代入點a,易得 b 1,當y c時 c 2 a 2 b 2 c 2 a 2 x 2 b 2 1 x 1 b 2c 2 a 2 所以過c的焦點且垂直長軸的弦長為2 1 b 2c 2 a 2 1帶入b 1而且a 2 c 2 b 2 容...