LightOj 1020 - A Childhood Game


 
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <cstring>
  4. #include <string>
  5. #include <map>
  6. #include <stack>
  7. #include <queue>
  8. #define LL long long
  9. #define L long
  10. #define sf scanf
  11. #define pf printf
  12.  
  13. using namespace std;
  14.  
  15. int main()
  16. {
  17.     int tc,t=0;
  18.     cin >> tc;
  19.  
  20.     while(tc--)
  21.     {
  22.          LL n;
  23.          sf("%lld",&n);
  24.          string s;
  25.          cin >> s;
  26.  
  27.          if(s=="Alice")
  28.          {
  29.              if(n%3==1)
  30.              {
  31.                  pf("Case %d: Bob\n",++t);
  32.              }
  33.  
  34.              else
  35.              {
  36.                  pf("Case %d: Alice\n",++t);
  37.              }
  38.          }
  39.  
  40.          else
  41.          {
  42.              if(n%3==0)
  43.              {
  44.                  pf("Case %d: Alice\n",++t);
  45.              }
  46.  
  47.              else
  48.              {
  49.                  pf("Case %d: Bob\n",++t);
  50.              }
  51.          }
  52.     }
  53.  
  54.     return 0;
  55. }

Comments

Popular posts from this blog

SPOJ-CMG - Collecting Mango

LightOJ 1009 - Back to Underworld

LeetCode Palindrome Number