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

这个式子怎么推出来的?

Posted by xfxyjwf at 2005-07-09 23:09:30 on Problem 1067
In Reply To:不行了,rp问题大了,谁帮忙看看 Posted by:achilles at 2005-07-09 22:59:09
> #include<stdio.h>
> #define R 1.61803398874989484820458683436564
> #define r 0.61803398874989484820458683436564
> 
> int main()
> {
>     int a,b;
>     int max,min; 
>     int i;
>     while(scanf("%d%d",&a,&b)!=EOF)
>     {
>        min = a > b ? b:a;
>         max =  a > b ? a:b;
>         i = (int)(r*min);
>         if(min!=(int)(R*i))
>           i++; 
>         if( max==min+i )
>           printf("0\n");
>         else
>           printf("1\n");                 
>     }
>     return 0;      
> }

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