#include Int main () { Int b; B=6; While (getchar ()!=b) Printf (" "); Printf (" does not perform "); return 0; } In what way the input ASCII characters "ACK", while judgment is false? If I enter the ACK, I will only in A single character to calculate A C K
Before have a similar problem, let me know my mistake, also know that the single character input can be directly, Such as the b=6 b=54 instead, and then directly enter 6, will only print does not perform after running,
CodePudding user response:
At the same time press Ctrl and F
CodePudding user response:
ASC problems Int main () { Char STR [5]. While (gets (STR)!="ACK") Printf (" "); Printf (" does not perform "); return 0; } //getchar () function returns the obtaining of ASCII characters, such as your input is 6 use getchar (), he is the return value of the 54 //b=54, only your variables will only while the condition is true or directly make getchar ()! ='6'Int main () { Int b=54; //while (getchar ()!=b) While (getchar ()!='6') Printf (" "); Printf (" does not perform "); return 0; }
CodePudding user response:
Sorry, I'm using my mobile phone in online IDE input, so want to know about the,