Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - University C++ language has integer variables x, y.
University C++ language has integer variables x, y.
For example, x= 1 and y=2.

A.x/y*y 1/2*2=0 integer division, the result is still an integer, and the fractional part is discarded, so 1/2=0.

B.X%y*y% is a modular operation, and X%y represents the remainder of x divided by y. 1%2=0... 1 1*2=2 X%y*y =2

C.x/y*y+x%y According to the above two examples, we can know that x/y*y+x%y = 0+ 1= 1 is the same as X! !