| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:同志们,,终于胜利了,,,In Reply To:同志们,,终于胜利了,,, Posted by:deep_you at 2005-02-27 22:10:53 改成递推就行了
var
f:array[1..30,0..30] of longint;
m,n,i,j,t:integer;
begin
readln(m,n);
t:=0;
while (m+n<>0) do
begin
inc(t);
fillchar(f,sizeof(f),0);
for i:=1 to m do f[i,0]:=i;
for i:=0 to n do f[1,i]:=1;
for i:=1 to m do
for j:=1 to n do f[i,j]:=f[i-1,j-1]+f[i-1,j]+1;
writeln('Case ',t,': ',f[m,n]);
readln(m,n);
end;
end.
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator