A0 Power ProMicro

I am using a Knock Off Pro Micro. When I send 5 volts to pin A0 of the Pro Micro without supplying 5 volts to raw, the Pro Micro activates and runs the following uploaded program.

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(A0, INPUT);
}

// the loop function runs over and over again forever
void loop() {
  if(A0, HIGH)
  {
    digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
    delay(1000);                       // wait for a second
    digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
    delay(2000); 
  }// wait for a second
 else
 {
    digitalWrite(LED_BUILTIN, LOW);   // turn the LED on (HIGH is the voltage level)
    delay(20);                       // wait for a second
    digitalWrite(LED_BUILTIN, HIGH);    // turn the LED off by making the voltage LOW
    delay(2000);
   }
}

Why does the program run when 5 volts is supplied to A0 with 0 volts to raw?

Is there a way to prevent A0 from powering the ProMicro?

I am trying to send different values to an output pin depending on which input pins are high and low.

Any help would be much appreciated.

If you look at the datasheet for the ATmega32U4 microcontroller of the Micro (and other AVR MCUs) you will see in the Absolute Maximum Ratings section:

Voltage on any Pin except RESET and VBUS with respect to Ground(8).............................-0.5V to VCC+0.5V

My read of that says that if VCC is 0 V and you are supplying 5 V to A0 you are way over the Absolute Maximum Rating and as the datasheet says:

Stresses beyond those listed under “Absolute Maximum Ratings” may cause permanent damage to the device.

So just don't do it.

Also, the RAW pin is intended to be supplied with 6-12 V because it is connected to a voltage regulator which will reduce that to 5V. If you're supplying the board with 5 V this should be connected to the VCC pin. Powering the board with 5 V to the RAW pin will cause the board to be running below the minimum voltage to support 16 MHz. It may still work but there's really no reason to do this.