用来求n!。Private Function fact(byval n as integer) as long ;并在Form_Click

[复制链接]
查看11 | 回复1 | 2010-5-12 16:57:56 | 显示全部楼层 |阅读模式
Private Function fact(byval n as integer) as long ;并在Form_Click事件过程中调用fact函数来计算(m!-n!)/(m!+n!)的结果。其中m、n由用户输入。

回复

使用道具 举报

千问 | 2010-5-12 16:57:56 | 显示全部楼层
Private Sub Form_Click()dim n as integern=inputbox("please input n=")print fact(n)End SubPrivate Function fact(byval n as integer) as longIf n=0 then fact=1: exit FunctionFor i=1 to Nfact=fact*iNextEnd Sub
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行