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 drift_ice at 2007-04-17 21:03:06 on Problem 1067
#include <math.h>
main()
{
 int ax,bx,temp;
 int k,wantedax;
while(scanf("%d%d",&ax,&bx)==2){

 if(ax>bx){
  temp = bx;
  bx = ax;
  ax = temp;
 }

 k = bx - ax;
 wantedax = (floor)(k*(1.0+sqrt(5))/2.0 ); //如果换成 k*1.6180340 就不行 
 if(ax==wantedax)printf("%d\n",0);
   else printf("%d\n",1);

 }
}

为什么这样可以通过,而如果改成注释的值就是WA呢?想不明白啊

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