Time Limit: 1000MS | Memory Limit: 10000K | |
Total Submissions: 45409 | Accepted: 15533 |
Description
Input
Output
Sample Input
2 1 8 4 4 7
Sample Output
0 1 0
Source
记住模板吧:不理解判断相等的时候用的是取整后。
#include <iostream> #include <cmath> using namespace std; int main(){ int a, b; while(cin >> a >> b){ int mi = min(a,b); int ma = max(a,b); int t = (ma - mi) * (1.0 + sqrt(5.0)) / 2; //转为整数 if(t == mi){ cout << 0 << endl; } else{ cout << 1 << endl; } } return 0; }