Home > Back-end >  Case S, but to enter two S to perform
Case S, but to enter two S to perform

Time:10-20

CodePudding user response:

Why do you want to add getchar? delete

CodePudding user response:

You use getchar () is to block the enter? There is no need to block the enter key, so can remove getchar ()
this line of codeIf you want to block the enter key, please refer to the "c + + getchar () method of use"

CodePudding user response:

See no % c in the switch input, so the return will not be scanf_s receiving of the switch, but also need to add getchar (); It is recommended to switch {} getchar (); With this statement,
Because the switch of the statement if you have input, input after will leave \ n input buffer, so want to use getchar () receiving ~

Put your getchar () to change position