try this:
void setup() {
for(int i = 0; i < 4; i++)
{
pinMode(pins[i], INPUT);
digitalWrite(pins[i], HIGH);
}
}
The digialWrite enables a pull up resistor on the input. Without it the pin will be floating around picking up the local radio station or the neighbor's microwave oven.