How can i set the pin?

Not seeing it... but at least this needs to be:

int pins[] = {1, 2, 3, 4 };
int numPins = sizeof pins[] / sizeof pins[0];
int result = HIGH;
for (int i = 0; i < numPins; i++) {
  result &= digitalRead( pins[i] );
}