parent
2b6ab2c658
commit
593e84a39e
@ -1,2 +1,40 @@
|
|||||||
#include<stdio.h>
|
|
||||||
|
{4,0,0,8,0,3,0,0,1},
|
||||||
|
{7,0,0,0,2,0,0,0,6},
|
||||||
|
{0,6,0,0,0,0,2,8,0},
|
||||||
|
{0,0,0,4,1,9,0,0,5},
|
||||||
|
{0,0,0,0,8,0,0,7,9}};
|
||||||
|
printSudoku(board);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
void printSudoku(int board[SIZE][SIZE])
|
||||||
|
{
|
||||||
|
for (int i=0;i<SIZE;i++)
|
||||||
|
{
|
||||||
|
for(int j=0;j<SIZE;j++)
|
||||||
|
{
|
||||||
|
printf("%2d",board[i][j]);
|
||||||
|
if((j+1)%3==0&&j<SIZE-1)
|
||||||
|
{
|
||||||
|
printf("|");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
if((i+1)%3==0&&i<SIZE-1)
|
||||||
|
{
|
||||||
|
for(int k=0;k<SIZE;k++)
|
||||||
|
{
|
||||||
|
if((k+1)%3==0&&k<SIZE-1)
|
||||||
|
{
|
||||||
|
printf("|");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("---");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in new issue