One Card Poker——AtCoder - abc054_a
题目
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:
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;
} -
//有点乱,望见谅。
总结
以上是生活随笔为你收集整理的One Card Poker——AtCoder - abc054_a的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 车主因眼睛小被自动驾驶误判?——智能座舱
- 下一篇: 001 量子计算与复数