日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

One Card Poker——AtCoder - abc054_a

發(fā)布時間:2024/1/8 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 One Card Poker——AtCoder - abc054_a 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

題目

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:

  • Each player picks one card from the deck. The chosen card becomes the player's hand.
  • The players reveal their hands to each other. The player with the stronger card wins the game.
    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;
      }

    • //有點亂,望見諒。

    總結(jié)

    以上是生活随笔為你收集整理的One Card Poker——AtCoder - abc054_a的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。