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

why WA (code Pascal) Help 1942 !!!!!!!

Posted by My_loves at 2005-10-12 20:52:10 on Problem 1942
program p1942;
 var n,m,max,min:longint;
     out:int64;

 procedure init;
  begin
   readln(n,m);
   if (n=0) and (m=0) then halt;
   if n>m then begin max:=n;min:=m end
          else begin max:=m;min:=n end;
  end;

 procedure main;
  var i,j:longint;
  begin
   j:=1;
   for i:=(n+m) downto max+1 do
    begin
     out:=out*i div j;
     inc(j);
    end;
   writeln(out);
  end;

 begin
  rewrite(output);
  repeat
   out:=1;
   init;
   main;
  until false;
 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