POJ 1067

来源:互联网 发布:软件测评师考试内容 编辑:程序博客网 时间:2024/04/30 07:39

#include<stdio.h>
#include<math.h>
void swap(int *a,int *b)
{
 int tmp;
 tmp=*a;
 *a=*b;
 *b=tmp;
}
int main()
{
 int a,b;
 while(scanf("%d%d",&a,&b)!=EOF)
 {
  if(a>b)
   swap(&a,&b);
  int diff=b-a;
  double mul=(1+sqrt(5.0))/2;//sqrt(5)会complie  error ,改成sqrt(5.0)就行了
  int ans=1;
  if(a==floor(diff*mul))
   ans=0;
  printf("%d\n",ans);
 }
 return 0;

}

原创粉丝点击