Description
Input
Output
Sample Input
2 1 8 4 4 7
Sample Output
0 1 0
1 #include<iostream> 2 #include<string.h> 3 #include<stdio.h> 4 #include<ctype.h> 5 #include<algorithm> 6 #include<stack> 7 #include<queue> 8 #include<set> 9 #include<math.h> 10 #include<vector> 11 #include<map> 12 #include<deque> 13 #include<list> 14 using namespace std; 15 int main () 16 { 17 int a, b; 18 int k, c; 19 while ( scanf ( "%d%d", &a, &b ) != EOF ) 20 { 21 if (a == 0 && b == 0) 22 { 23 printf("1 "); 24 continue; 25 } 26 if ( a > b ) 27 { 28 c = a; 29 a = b; 30 b = c; 31 } 32 k = b - a; 33 c = ( int )( ( ( 1.0 + sqrt ( 5.0 ) ) / 2.0 ) * ( double )k ); 34 if ( c == a ) 35 { 36 printf ( "0\n" ); 37 } 38 else 39 { 40 printf ( "1\n" ); 41 } 42 } 43 return 0; 44 }
原文:http://www.cnblogs.com/qscqesze/p/3877314.html