when i use cin to get an int and user enter a float number, apparently nothing is wrong; but when you use cin in the condi