作业帮 > 综合 > 作业

pascal 阶乘BackgroundThe problem is simple.You need to calcula

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/23 15:02:24
pascal 阶乘
Background
The problem is simple.You need to calculate the number of digit of the factorial of K (1
首先回答第二问:repeat ... until 布尔表达式.
第一问:
var i,n,j:integer;
s,a:longint;
b:array[1..100]of longint;
begin
readln(n);
a:=1;
for i:= 1 to n do
begin
s:=i;
while s=0 do
begin
a:=a*i;
s:=s-1;
end;
b[i]:=a;
end;
s=0;
for i:=1 to n do s:=b[i]+s;
writeln(s);
end.