Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Let A be an integer variable with an initial value of A. What is the value of A after the statement a+=a-=a*a is executed? Please write down the results and calculation ideas, thank you.
Let A be an integer variable with an initial value of A. What is the value of A after the statement a+=a-=a*a is executed? Please write down the results and calculation ideas, thank you.
The system first opens the address storage variable, and then calculates the value. be as above

A=a+(a-a*a), where a is 12, the computer first calculates the value of the second equal sign, namely

A=a+(- 132)。 Although A has changed to-132 at this time, the first A originally allocated is still 12 (which can be understood as another variable address), so the final result is 12+(- 132) = 65438.