Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:同志们,,终于胜利了,,,

Posted by JiangLY at 2005-04-09 18:23:15 on Problem 1243
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator