Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int grid[9][9];
- void limpar_tela()
- {
- if (system ("cls"))
- {
- system ("reset");
- }
- else
- {
- system("cls");
- }
- }
- void mostrar_grid()
- {
- int x;
- cout << " 1 2 3 4 5 6 7 8 9" << endl << " ----------------------------------- " << endl;
- for (x=0; x<9;x++)
- {
- cout << x+1 << " | " << grid[x][0] << " " << grid[x][1] << " " << grid[x][2] << " | " << grid[x][3] << " " << grid[x][4] << " " << grid[x][5] << " | " << grid[x][6] << " " << grid[x][7] << " " << grid[x][8] << " | " << endl;
- if ((x==2) || (x==5) || (x==8))
- {
- cout << " ----------------------------------- " << endl;
- }
- }
- }
- int main()
- {
- limpar_tela();
- mostrar_grid();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement