View Code of Problem 197

#include  <stdio.h>
#include  <stdlib.h>
#include  <math.h>
#include  <string.h>

void ffff(int a,int _b)
{
	int b;
	double bb;
	//b = (((2.5)/(1.5)*a)+0.5);
	//b = ((sqrt(5)+3)/(sqrt(5)+1)*a+0.5);
	b = 5.0*a/3.0;
	bb = ((sqrt(5)+3)/(sqrt(5)+1)*a+0.5);
	printf("%d\n",!((fabs(_b-bb)<1.0)));// &&_b*1.0<bb
}
int main()
{
	int a,b;
	while(scanf("%d%d",&a,&b)!=EOF)
	{
		//printf("%d,%d: ",a,b);
		if(a>=b)
		{
			ffff(b,a);
		}
		else
		{
			ffff(a,b); 
		}
	}
	
	
	return 0;
}

Double click to view unformatted code.


Back to problem 197