fork(1) download
  1. #include <algorithm>
  2. #include <iostream>
  3.  
  4. #define SIZE 3
  5. int theBoard[SIZE][SIZE] = {{1,2,3},{4,5,6},{7,8,9}};
  6.  
  7. bool won(int gameBoard[][SIZE])
  8. {
  9. return std::is_sorted(&gameBoard[0][0], &gameBoard[SIZE-1][SIZE]);
  10. }
  11.  
  12. int main()
  13. {
  14.  
  15. std::cout << won(theBoard);
  16. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
1