One Card Poker

时间:2023-03-08 22:27:48
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.

样例输入1 复制
8 6
样例输出1
Alice
样例输入2 复制
1 1
样例输出2
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;
    }
}

提交代码
Accepted!   CPU time: 1ms   查看详情

Copyright © 2016 qsc大学foobar学院 京ICP备233333号-1