Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Why are integers entered in C++ and floating-point numbers displayed?
Why are integers entered in C++ and floating-point numbers displayed?
The main reason is that you entered 8, 5.

CIN & gt; & gta & gt& gtb

This statement uses spaces or carriage returns to separate A and B, and you also use Chinese, which leads to incorrect data received. What you see here is that B received it, and when it was forcibly converted to int type, it became such a long number.

Just change it to 8.5.