编写VB程序,计算1!+(1!+2!)+……+(1!+2!+……+7!))

[复制链接]
查看11 | 回复3 | 2009-5-9 20:33:48 | 显示全部楼层 |阅读模式
简单易懂的!

回复

使用道具 举报

千问 | 2009-5-9 20:33:48 | 显示全部楼层
sub myfun(byval maxNum as integer)dim i as intgerdim sum as integerdim j as integer sum=0jc=1for i=1 to maxNum
jc=1
for j=1 to i
jc=jc*j
next
sum=sum+jc
next myfun=sumend sub '运用举例:如 myfunc(7) 结果就如你上面举的例子...
回复

使用道具 举报

千问 | 2009-5-9 20:33:48 | 显示全部楼层
dim a,b,c,i,j as interger a=1 b=0 c=0 for i=1 to 7 for j=1 to i a=a*j b=b+a next j c=c+b next i'不懂的问我...
回复

使用道具 举报

千问 | 2009-5-9 20:33:48 | 显示全部楼层
Private Sub Command1_Click()a = 1: s = 0: m = 0For j = 1 To 7 a = a * j s = s + a m = m + sNext jPrint mEnd Sub...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行