计算1*2*3*...*n>1000的第一个n值(用pascal语言,while循环和repeat循...
发布网友
发布时间:2024-10-13 16:16
我来回答
共4个回答
热心网友
时间:2024-10-13 17:22
var
n,s:longint;
begin
n:=1;
s:=1;
while s<=100 do begin
s:=s*n;
n:=n+1;
end;
writeln(n);
end.
var s,n:longint;
begin
s:=1;
n:=1;
repeat
inc(n);
s:=s*n;
until s>1000;
write(n);
end.
热心网友
时间:2024-10-13 17:22
var
n,s:longint;
begin
n:=1;
s:=1;
while s<=100 do begin
s:=s*n;
n:=n+1;
end;
writeln(n);
end.
热心网友
时间:2024-10-13 17:23
var s,n:longint;
begin
s:=1;
n:=1;
repeat
inc(n);
s:=s*n;
until s>1000;
write(n);
end.
热心网友
时间:2024-10-13 17:27
program aaa;
var
s,n:integer;
begin
s:=1;
n:=1;
while s<=1000 do
begin
n:=n+1;
s:=s*n;
end;
writeln(n);
end.
program aaa;
var
s,n:integer;
begin
s:=1;
n:=1;
repeat
n:=n+1;
s:=s*n;
until s>1000;
writeln(n);
end.