写函数内容:名为fact的求N的阶乘的函数 写出语言:调用fact,求8的阶乘并输出在名为MyMemo的TMemo类控件

[复制链接]
查看11 | 回复1 | 2008-6-18 22:58:59 | 显示全部楼层 |阅读模式
function fact(n:integer):integer;begin if n>1 then fact:=n * fact(n-1); if n=1 then fact:=1; if n<1 then fact:=0;end;procedure TForm1.Button1Click(Sender: TObject);beginMyMemo.Lines.Add(inttostr( fact(8)));end;
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行