OJ-Problems-Source/HDOJ/1907_autoAC.cpp

22 lines
395 B
C++

#include<stdio.h>
int main()
{
int temp,t,n,s,x,i;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
for(i=s=temp=0;i<n;i++)
{
scanf("%d",&x);
if(x>1) temp=1;
s^=x;
}
if((s&&temp)||(!s&&!temp))
puts("John");
else
puts("Brother");
}
return 0;
}