Surely you created the initial grid using this code:
int img[10][10];
for(int i=0;i<10;i++) {
for(int j=0;j<10;j++) {
img[i][j] = 0;
}
}
and not this:
img[i][j] = j;
I would just add this second loop (run after the first) to fill in the ones:
for(int i=1;i<=3;i++) {
for(int j=2;j<=4;j++) {
img[i][j] = 1;
}
}