View Code of Problem 197

#include<stdio.h>
#include<math.h>
#include<string.h>
int main(){
	int a,b;
	while(scanf("%d %d",&a,&b)!=EOF){
		int min = fmin(a,b);
		int max = fmax(a,b);
		int c = (int)(max-min)*(sqrt(5)+1)/2;        //公式 记住即可 
		if(c==min)
			printf("0\n");
		else
			printf("1\n");
	}
} 

Double click to view unformatted code.


Back to problem 197