scanf issue when reading double

前端 未结 2 415
不思量自难忘°
不思量自难忘° 2021-01-23 20:14

I\'m using MinGW on windows 7 to compile C files.

My problem is a strange behaviour with scanf() to read doubles from user input.

My co

2条回答
  •  醉梦人生
    2021-01-23 21:02

    You have the same solution for a little bit different problem (just in type of variable)

    Why does scanf ask for input twice, but just in the first loop iteration only?

    When you include the whitespace in the scanf

    The program will wait until you enter a blank space or any other value in it, so the program will continue as normal, but the blank space or any value that you entered will not be used anyway.

提交回复
热议问题