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

歡迎訪問 生活随笔!

生活随笔

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

编程问答

1.25 Tic-tac-toe

發布時間:2024/1/8 编程问答 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 1.25 Tic-tac-toe 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

https://acs.jxnu.edu.cn/problem/CF3Chttps://acs.jxnu.edu.cn/problem/CF3C

描述:

Certainly, everyone is familiar with tic-tac-toe game. The rules are very simple indeed. Two players take turns marking the cells in a?3?×?3?grid (one player always draws crosses, the other — noughts). The player who succeeds first in placing three of his marks in a horizontal, vertical or diagonal line wins, and the game is finished. The player who draws crosses goes first. If the grid is filled, but neither Xs, nor 0s form the required line, a draw is announced.

最近,每個人都對井字游戲很感興趣。規則很簡單。兩個玩家輪流在3×3的方格中畫標記(一個玩家通常畫圓,一個畫叉)。首先成功地將他的三個標記放置在水平、垂直或對角線上的玩家獲勝,且游戲結束。畫X的玩家先畫。如果網格已填滿,但 X 和 0 均未形成所需的行,則宣布平局。

You are given a?3?×?3?grid, each grid cell is empty, or occupied by a cross or a nought. You have to find the player (first or second), whose turn is next, or print one of the verdicts below:

給你一個 3 × 3 網格,每個網格單元是空的,或者被X或?占據。 您必須找到下一個輪到的玩家(第一個或第二個),或打印以下判決之一:

  • illegal?— if the given board layout can't appear during a valid game;
  • the first player won?— if in the given board layout the first player has just won;
  • the second player won?— if in the given board layout the second player has just won;
  • draw?— if the given board layout has just let to a draw.
  • 非法的——如果給定的期盼布局不能有效地出現在棋盤里。
  • 第一個玩家獲勝——在給定的棋盤中出現第一個玩家獲勝。
  • 第二個玩家獲勝——如果在給定的棋盤中出現第二個玩家獲勝。
  • 平局——如果在給定的棋盤中出現平局的情況。

輸入:

The input consists of three lines, each of the lines contains characters ".", "X" or "0" (a period, a capital letter X, or a digit zero).

輸入包含3行,每一行包含符號".", "X" or "0"(句點、大寫字母 X 或數字零)。

輸出:

Print one of the six verdicts:?first,?second,?illegal,?the first player won,?the second player won?or?draw.

輸出一下六種情況之一:第一個,第二個,非法,第一個玩家獲勝,第二個玩家獲勝或者平局。

樣例輸入:

X0X .0. .X.

樣例輸出:

second

總結

以上是生活随笔為你收集整理的1.25 Tic-tac-toe的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。