Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
各位大牛小牛,帮忙看下一个很诡异的问题#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator