learnedfor loop,In practice when it came to getchar()) != ‘n’ The problem。I.e.while loopSo that in thefor loopEnter the void (to be treated as a character。)
All to known,getchar functionUsed to get the character,And if the direct use in a loop,It found that the situation will not be able to press enter characters into the system。The reason is the carriage return character is so ~,At the same time we want to add[……]