C language scanf to read the rules about tips_2 Summary

The first point: scanf default carriage and a space are input and the end symbol intervals between the different groups. That he does not read spaces and line breaks. But to treat them as a sign of complete data is read! 

example

  Two input methods

To read the second point scanf newline or by a space need be represented, for example, so% c

You can see the first line break and after reading all the space to.

 

Guess you like

Origin www.cnblogs.com/LuoRuidiLoveMiku/p/11370308.html