http://blog.youkuaiyun.com/h1021456873/article/details/49748659这篇博客讲的很好关于这个博弈
#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
int main()
{
int a,b;
int n;
cin>>n;
while(n--)
{
cin>>a>>b;
if(a>b)
swap(a,b);
int temp=(b-a)*(sqrt(5)+1)/2;
if(a==temp)
cout<<"B"<<endl;
else
cout<<"A"<<endl;
}
return 0;
}
/*
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
int t,n,m,temp;
scanf("%d",&t);
while(t--) {
scanf("%d%d",&n,&m);
if(n>m) swap(n,m);
temp=(m-n)*(sqrt(5)+1)/2;
if(n==temp) printf("B\n");
else printf("A\n");
}
return 0;
}
*/