current position:Home>Here's why getchar can be executed. After it becomes scanf, even if the correct value is entered, it still prompts for input error

Here's why getchar can be executed. After it becomes scanf, even if the correct value is entered, it still prompts for input error

2022-02-02 22:33:53 CSDN Q & A

img




Refer to the answer 1:

if(d>=0&&d<=’9")




Refer to the answer 2:



Refer to the answer 3:

You shouldn't use variables d Do you ,c It's a int, You should be with 0 and 9 Compare , Rather than '0','9' To compare .
Write too much useless code , Confused yourself




Refer to the answer 4:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202022233522147.html

Random recommended