Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. using namespace std;
  4.  
  5. int ChessBoard[8][8];
  6.  
  7. // Function prototypes
  8. void PrintBoard(int[8][8]);
  9.  
  10.  
  11. int main() {
  12. // Init everything to zero
  13. for(int i = 0; i < 8; i++)
  14. for(int j = 0; j < 8; j++)
  15. ChessBoard[i][j] = i*j;
  16.  
  17.  
  18.  
  19. PrintBoard(ChessBoard);
  20.  
  21. system("pause");
  22.  
  23. }
  24.  
  25. void PrintBoard(int board[8][8]) {
  26. for(int i = 0; i < 8; i++) {
  27. for(int j = 0; j < 8; j++)
  28. printf("%-3d", ChessBoard[i][j]);
  29.  
  30. printf("\n");
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement