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:<DELPHI>I also get WA!!!

Posted by liuyuyangfoam at 2006-02-07 14:01:34 on Problem 2613
In Reply To:<DELPHI>I also get WA!!! Posted by:Muchacheva_Marina at 2005-09-13 22:12:13
> I don't know were is my mistake! Please, help me find it.
> 

溢出

> This is code:
> 
> {$APPTYPE CONSOLE}
> {$i-,q-,r-,n+}
> 
> type int = longint;
> 
> var m, n, r, s, i, max : int;
>     ans : extended;
> 
> BEGIN
>   while not eof do begin
>     readln(m, n, r, s);
>     ans := 1; max := 0;
>     if max < m then max := m;
>     if max < r then max := r;
> 
>     for i := 1 to max do begin
>       if i <= m then ans := ans*i;
>       if i <= r then ans := ans/i;
> 
>       if i <= s then ans := ans*i;
>       if i <= n then ans := ans/i;
> 
>       if i <= r-s then ans := ans*i;
>       if i <= m-n then ans := ans/i;
>     end;
>     writeln(ans:0:5);
>   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