首页 > TAG信息列表 > TicTacToe
348. Design Tic-Tac-Toe
class TicTacToe { int n; int[] rows; int[] cols; int diag=0; int antiDiag = 0; public TicTacToe(int n) { this.n = n; rows = new int[n]; cols = new int[n]; } public int move(int row, int col, inC++实现井字棋游戏
C++实现井字棋游戏 #include<iostream> #include<cstdlib> #include<cstdio> using namespace std; class TicTacToe { private: char currentPlayer; char board[3][3]; public: TicTacToe(); void print(); char getCurrentPlayer(); char getWinner()