VB作业,急求啊!!!求1!+2!+....+10!,用function过程编写求阶乘函数。...

2024-10-31 00:03:53
推荐回答(1个)
回答1:

option explicit
Private sub form_click()
dim sum as long
dim i as long
for i=1 to 10
sum=sum+factor(i)
next
end sub
Private function factor(n as long) as long
dim i as long
factor=1
for i=1 to n
factor=factor*i
next
end function