One Card Poker

One Card Poker

发布时间: 2017年2月14日 14:02   最后更新: 2017年2月14日 14:09   时间限制: 1000ms   内存限制: 128M

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;
 
int main()
 
{
 
    while(scanf("%d%d",&a,&b)==2){
 
    if(a==1) a=a+13;
 
    if(b==1) b=b+13;
 
    if(a>b) cout<<"Alice"<<endl;
 
    if(a==b) cout<<"Draw"<<endl;
 
    if(a<b) cout<<"Bob"<<endl;
 
    }
 
}
 
 


 
原文地址:https://www.cnblogs.com/lizinuo/p/6522415.html