、数学上把从 1 开始的连续自然数相乘叫做阶乘。例如 把1*2*3*4*5 称作5的阶乘, 记为5!。 编写一个求n!

[复制链接]
查看11 | 回复1 | 2011-1-31 14:15:54 | 显示全部楼层 |阅读模式

assign(input,'文件名.in');assign(output,'文件名.output);
reset(input);rewrite(output)保存

回复

使用道具 举报

千问 | 2011-1-31 14:15:54 | 显示全部楼层
program ex1;var n:integer; sum:=longint;begin assign(input,'文件名.in');assign(output,'文件名.output');(output还是out?)readln(n);sum:=1;for i:=2 to n do sum:=sum*i;writeln(sum);reset(input);rewrite(output);end.
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行