View Code of Problem 122

#include <iostream>
#include <cstdio>
using namespace std;

int main(){
    int T;
    while(cin>>T){
      for(int i=0;i<T;i++){
            int n=0;
            scanf("%d",&n);
            if(n<=1){
                return 0;
            }
            if(n>1){
            int edge[n+1][2];
            for(int i=1;i<=n-1;i++){
                scanf("%d %d",&edge[i][0],&edge[i][1]);
            }
            if((n-1)%2==0){
                cout<<"Bob"<<endl;
            }else if((n-1)%2==1){
                cout<<"Alice"<<endl;
            }
      }
      }
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 122