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;
}
}
Copyright © 2016 qsc大学foobar学院 京ICP备233333号-1
One Card Poker的更多相关文章
- Java-->发牌流程修改版
--> 这一次要封装得狠一点... package com.xm.ddz; // 每一张牌的属性 public class Card { private String flowerColor; ...
- ios9基础知识(UI)总结
UIWindow.UILabel.UIColor.UIScreen.UIViewController.UIView.UIControl.UIButton.IBOutlet.IBAction.UISte ...
- Swift - 类型嵌套(以扑克牌结构体为例)
类型嵌套,简单来说实在一个类型中包含另外一个类型.我们拿一副扑克来说明. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 //类 ...
- 【原】Java学习笔记029 - 映射
package cn.temptation; import java.util.HashMap; import java.util.Map; public class Sample01 { publi ...
- AtCoder Beginner Contest 054 ABCD题
A - One Card Poker Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Ali ...
- AtCoder Beginner Contest 054
1. A - One Card Poker 水题,直接输出大小. 2. B - Template Matching 暴力,每个位置枚举,比较. 3. C - One-stroke Path n的大小只 ...
- 通过欧拉计划学Rust编程(第54题)
由于研究Libra等数字货币编程技术的需要,学习了一段时间的Rust编程,一不小心刷题上瘾. 刷完欧拉计划中的63道基础题,能学会Rust编程吗? "欧拉计划"的网址: https ...
- 通过与C++程序对比,彻底搞清楚JAVA的对象拷贝
目录 一.背景 二.JAVA对象拷贝的实现 2.1 浅拷贝 2.2 深拷贝的实现方法一 2.3 深拷贝的实现方法二 2.3.1 C++拷贝构造函数 2.3.2 C++源码 2.3.3 JAVA通过拷贝 ...
- 【霍夫曼树】poj 1339 poker card game (数组排序+辅助队列的方法,预处理O(nlogn),构造霍夫曼树O(n))
poj.org/problem?id=1339 #include<iostream> #include<cstdio> #include<string> #incl ...
随机推荐
- LINQ to Sql系列二 简单查询和联接查询
这一篇文章主要总结LINQ to sql的简单查询(单表查询)和联接查询(多表查询) 单表查询 需求是我们要输出TClass表中的结果.使用了from-in-select语句,代码如下: public ...
- IIS7和Tomcat7整合,即IIS7和Tomcat共用80端口
IIS7和Tomcat7整合,即IIS7和Tomcat共用80端口 背景: 最近公司有一个项目要上线,需要用到iis和tomcat整合,共用80端口.由于公司的数据都非常重要,只通过端口映射到外网的8 ...
- 【python基础】 Tkinter小构件之canvas 画布
[python之tkinter画布] 要画布就要使用tkinter的小构件,canvas(结构化的图形,用于绘制图形,创建图形编辑器以及实现自定制的小构件类) 我们先使用create_rectangl ...
- ZLG_GUI和3D显示的移植
最近学习NRF51822,想在OLED上移植个强大的GUI ,本来想学习emWIN的,甚至想直接学习自带GUI的嵌入式操作系统RTThread,但是......哎,太懒了.....现在觉得ZLG_GU ...
- WinForm——记住密码
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Runti ...
- redisson实现分布式锁原理
*:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* ...
- 你需要了解的 Core Spotlight
你需要了解的 Core Spotlight -- 了解Spotlight Core Spotlight是iOS 9中苹果推出了新的Search API,可以直接搜App内的内容(in-App Sear ...
- 修改UITextField的占位文字颜色的三种层次
层次一:利用富文本 // 描述占位文字属性 NSMutableDictionary *dict = [NSMutableDictionary dictionary] ; dict[NSForegrou ...
- 设置npm安装模块目录<nodejs>
nodejs安装模块命令: npm install <input_name> # 本地安装 npm install <input_name> -g # 全局安装 1.npm i ...
- 《浅谈架构之路:单点登录 SSO》
前言:SSO 单点登录 “半吊子”的全栈工程师又来了,技术类的文章才发表了两篇,本来想先将主攻的几个系列都开个头(Nodejs.Java.前端.架构.全栈等等),无奈博客起步太晚,写博文的时间又没有很 ...