一個博弈論題目,地址:http://acm.pku.edu.cn/JudgeOnline/problem?id=1067
#include <stdio.h>
#include <math.h>

int main ()


{
int a, b;
int k, c;

while ( scanf ( "%d%d", &a, &b ) != EOF )

{
if ( a > b )

{
c = a;
a = b;
b = c;
}

k = b - a;

c = ( int )( ( ( 1.0 + sqrt ( 5 ) ) / 2.0 ) * ( double )k );

if ( c == a )

{
printf ( "0\n" );
}
else

{
printf ( "1\n" );
}
}
return 0;
}
#include <stdio.h>
#include <math.h>
int main ()

{
int a, b;
int k, c;
while ( scanf ( "%d%d", &a, &b ) != EOF )
{
if ( a > b )
{
c = a;
a = b;
b = c;
}
k = b - a;
c = ( int )( ( ( 1.0 + sqrt ( 5 ) ) / 2.0 ) * ( double )k );
if ( c == a )
{
printf ( "0\n" );
}
else
{
printf ( "1\n" );
}
}
return 0;
}

