很奇怪!为什么输入小数(比如0.5)就无限循环??
int main(void){
int code = 19;
int entered;
printf("Welcom! \n");
printf("please enter the number: ");
scanf("%d", &entered);
while (entered != code)
{
printf("Welcom! \n");
printf("please enter the number: ");
scanf("%d", &entered);
}
printf("Congratulations!\n");
return 0;
}
为什么输入小数(比如0.5)就无限循环??
谢谢!