当前位置: 首页 > 工具软件 > card one > 使用案例 >

One Card Poker——AtCoder - abc054_a

安轶
2023-12-01

题目

Problem Statement

Alice and Bob are playing One Card Poker.
One Card Poker is a two-player game using playing cards.

Each card in this game shows an integer between 1 and 13, inclusive.
The strength of a card is determined by the number written on it, as follows:

Weak 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9 << 10 << 11 << 12 << 13 << 1 Strong

One Card Poker is played as follows:

  1. Each player picks one card from the deck. The chosen card becomes the player's hand.
  2. The players reveal their hands to each other. The player with the stronger card wins the game.
    If their cards are equally strong, the game is drawn.

You are watching Alice and Bob playing the game, and can see their hands.
The number written on Alice's card is AA, and the number written on Bob's card is BB.
Write a program to determine the outcome of the game.

要求

  • 1≦A≦13
  • 1≦B≦131≦B≦13
  • AA and BB are integers.
  • 输入
  • The input is given from Standard Input in the following format:

    AA BB
  • 输出
  • Print Alice if Alice will win. Print Bob if Bob will win. Print Draw if the game will be drawn.
  • 样例
  • InputcopyOutputcopy
    8 6
    Alice

    8 is written on Alice's card, and 6 is written on Bob's card. Alice has the stronger card, and thus the output should be Alice.

  • 代码

  • #include<iostream>

  • using namespace std;

  •  int n,m;
    int main(){
    cin>>n>>m ;
        if(n==1){
        n=n+13;    
                   } 
             if(m==1){
             m=m+13;    
                       } 
        if(n>m){
              cout<<"Alice"<<endl;    
           }else if(n==m){
                cout<<"Draw"<<endl;    
              }else if(n<m) {
                   cout<<"Bob"<<endl;    
              }

  • return 0;
    }

  • //有点乱,望见谅。

 类似资料:

相关阅读

相关文章

相关问答