What do you suppose that '1' - '0' is? What do you suppose that '0' - '0' is?
Instead of the 4 line if statement to determine whether to set the pin HIGH or LOW, and to actually do it:
digitalWrite(puerto[i], numero[p][i] - '0');
all works, except the first 0
You need to explain that, in a lot more detail.