题目
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:
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.
要求
The input is given from Standard Input in the following format:
AA BB
Alice
if Alice will win. Print Bob
if Bob will win. Print Draw
if the game will be drawn.Inputcopy | Outputcopy |
---|---|
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;
}
//有点乱,望见谅。