看下上面我的总结就知道了!其实套下公式就都在了,这几类博弈还是比较容易的。
#include<cstdio>
#include <cstring>
#include<algorithm>
#include <iostream>
#include <cmath>
//#include <stdio.h>
#define ll long long
using namespace std;
int main()
{
int a,b;
while(cin>>a>>b){
if(a == 0 && b == 0)
break;
if(a > b)
swap(a,b);
double x = (b - a) * ( 1 + sqrt(5)) / 2;
if( a == (int)x)
cout<<"X"<<endl;
else
cout<<"H"<<endl;
}
return 0;
}