BZOJ 1022

时间:2014-10-27 19:19:43   收藏:0   阅读:154
program bzoj1022;
var    t,n,i,ans,k,j,k1,k2:longint;
    bo:boolean;
begin
    read(t);
    for k:=1 to t do begin
        read(n);
        ans:=0; k2:=0;
        for i:=1 to n do begin
            read(k1);
            if k1>1 then inc(k2);
            ans:=ans xor k1;
        end;
        if ((ans=0) and (k2>0)) or ((ans<>0) and (k2=0)) then writeln(Brother) else writeln(John);
    end;
end.

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!