#include<iostream> #include<string> #include<vector> #include<sstream> #include<algorithm> using namespace std; int main() { int a, b; while (cin >> a >> b) { if (a > b) { swap(a, b); } int c = b - a; double num = (sqrt(5) + 1) / 2; int temp = num * c; if (temp == a) { cout << 0 << endl; } else { cout << 1 << endl; } } return 0; } /* Main.cc: In function `int main()': Main.cc:17: error: `sqrt' undeclared (first use this function) Main.cc:17: error: (Each undeclared identifier is reported only once for each function it appears in.) */ |
Double click to view unformatted code.