The Tic-Tac-Toe game is a childhood memory of everyone. Even after people grow up, they still like to play it when they are bored! When you are alone, can you let the computer play with you?
OX 遊戲是大家小時候的童年記憶,甚至在長大後,無聊時還是會玩一下呢 ! 但當你一個人時,是否也能讓電腦跟你玩呢 ?
The first line of input contains an integer n (1 <= n <= 10), which is the number of the test sets. Each test set includes a 2-dimensional matrix of size 3 * 3. Element 0 means ‘O’ and 1 for ‘X.’ Please determine if there is a winner in the pattern.
Note: Any two matrix elements are separated by a space.
第一行輸入一個整數n(1 <= n <= 10),表示有n組測資。每組測資包含一個 3*3 的 2 維矩陣。矩陣的每一個單項0 代表 ‘O’ , 1 代表 ‘X’ 。註:每行的數字之間均以一個空格隔開。
If there is a winner in the test set, output 'True'; otherwise output 'False.'
Note: The result of each test data is printed in one line, and the end of the output needs a newline character.
輸出這場 OX 遊戲是否有勝負之分,有則輸出True,否則輸出False。註:每筆測資的結果列印於一行,輸出結尾需換行。
2 1 0 1 0 1 1 0 0 0 0 1 0 1 0 0 1 0 1
True False
編號 | 身分 | 題目 | 主題 | 人氣 | 發表日期 |
沒有發現任何「解題報告」 |