主题:新手问个问题(答出20+30分)
zhaoren
[专家分:420] 发布于 2005-09-23 19:24:00
输入2个数A,B,(0<A,B<50)输出
A!/(B!*(ABS(A-B)!))[em18][em18][em18]
回复列表 (共23个回复)
11 楼
梦幻神兵 [专家分:600] 发布于 2005-11-15 17:23:00
建议:
program t1;
var
a:array[1..2000]of integer;
n,i,s:integer;
function sti(n:integer):integer;
var
m,i,s;integer;
bagin
s:=1;
for i;=1 to n do
s:=s*i;
sti:=s;
end;
begin
read(a);
read(b);
write(sti(a));
write(sti(b));
write(sti(a+b));
writeln;
end.
12 楼
小虾虾 [专家分:300] 发布于 2005-11-17 16:01:00
二楼的,这要用高精度
13 楼
wyc4662 [专家分:0] 发布于 2007-09-29 13:11:00
ooo
14 楼
Lovely哆啦 [专家分:1360] 发布于 2007-09-29 15:46:00
不是很难呀!
15 楼
amyhab [专家分:120] 发布于 2007-10-02 09:22:00
好简单的咧
16 楼
gundamoo [专家分:10] 发布于 2007-10-12 19:30:00
阶乘一般都要用高精度吧 因为数字都很大[em12]
17 楼
xujunxun [专家分:0] 发布于 2007-10-29 20:01:00
Var
a,b,i,f,g:integer;
c,d,e,m:real;
Begin
Repeat
Readln(a,b)
Until (a>0) and (0<b<50);
c:=1;
d:=1;
e:=1;
For i:=a downto 1 do
c:=c*i;
For i:=b downto 1 do
d:=d*i;
f:=a-b;
For i:= f downto 1 do
e:=e*i;
g:=abs(e);
m:=c/(d*g);
Writeln(m);
End.
18 楼
xujunxun [专家分:0] 发布于 2007-10-29 20:02:00
Var
a,b,i,f,g:integer;
c,d,e,m:real;
Begin
Repeat
Readln(a,b)
Until (a>0) and (0<b<50);
c:=1;
d:=1;
e:=1;
For i:=a downto 1 do
c:=c*i;
For i:=b downto 1 do
d:=d*i;
f:=a-b;
For i:= f downto 1 do
e:=e*i;
g:=abs(e);
m:=c/(d*g);
Writeln(m);
End.
19 楼
xujunxun [专家分:0] 发布于 2007-10-29 20:03:00
Program t1;
Var
a,b,i,f,g:integer;
c,d,e,m:real;
Begin
Repeat
Readln(a,b)
Until (a>0) and (0<b<50);
c:=1;
d:=1;
e:=1;
For i:=a downto 1 do
c:=c*i;
For i:=b downto 1 do
d:=d*i;
f:=a-b;
For i:= f downto 1 do
e:=e*i;
g:=abs(e);
m:=c/(d*g);
Writeln(m);
End.
20 楼
xujunxun [专家分:0] 发布于 2007-10-29 20:05:00
Program t1
Var
a,b,i,f,g:integer;
c,d,e,m:real;
Begin
Repeat
Readln(a,b)
Until (a>0) and (0<b<50);
c:=1;
d:=1;
e:=1;
For i:=a downto 1 do
c:=c*i;
For i:=b downto 1 do
d:=d*i;
f:=a-b;
For i:= f downto 1 do
e:=e*i;
g:=abs(e);
m:=c/(d*g);
Writeln(m);
End.
我来回复