1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
// Make a checkerboard - 8x8
//April 16, 2011
#include <iostream>
#include <string>
using namespace std;
int main()
{
const int rows = 5;
const int columns = 5;
char board [rows][columns] =
{
{'X', 'X', 'X', 'X', 'X',},
{'X', ' ', 'X', ' ', 'X',},
{'X', ' ', 'X', ' ', 'X',},
{'X', ' ', 'X', ' ', 'X',},
{'X', 'X', 'X', 'X', 'x',}
};
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < columns; j++)
{
cout << board[i][j];
}
cout << endl;
}
}
|