12293 - Box Game

和书上的例题是一样的。

View Code
 1 #include<cstdio>
 2 #include<iostream>
 3 using namespace std;
 4 
 5 typedef long long ll;
 6 
 7 ll solve(ll n) {
 8     return (n & 1) ? solve(n / 2) : n / 2;
 9 }
10 int main() {
11     ll n;
12     while(cin >> n && n) {
13         if(solve(n)) cout << "Alice" << endl;
14         else cout << "Bob" << endl;
15     }
16     return 0;
17 }

 

posted @ 2013-01-31 21:57  ACSeed  Views(68)  Comments(0)    收藏  举报