One Card Poker

Alice和Bob在玩一个卡牌游戏,这个卡牌游戏叫做“比大小”!所有的卡牌的面值都是1~13的整数,谁的卡牌大,谁就胜利。但是卡牌的规则可能和平常的不太一样,大小规则如下:

小 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9 < 10 < 11 < 12 < 13 < 1 大

换言之,1是最大的,2是最小的,和斗地主有点像哦。

现在你需要写一个程序,来判断究竟是谁取得了胜利。

Alice胜利输出Alice,Bob胜利输出Bob,平局输出Draw

1≦A≦13
1≦B≦13
A and B are integers.
A is Alice,B is Bob.
The input is given from Standard Input in the following format:
A B

Print Alice if Alice will win. Print Bob if Bob will win. Print Draw if the game will be drawn.


8 6
Alice
 
1 1
Draw
题解

#include<bits/stdc++.h>
using namespace std;
int a,b;
main()
{
cin>>a>>b;
if(a==1)
a=1+13;
if(b==1)
b=1+13;
if(a>b)
cout<<"Alice";
if(a==b)
cout<<"Draw";
if(a<b)
cout<<"Bob";
}

 
原文地址:https://www.cnblogs.com/gfdybz/p/6522511.html