the first picture of the code is compiled, me and others are not quite same, want to teach any mistakes or insufficient, topic is this: your program to read a line of text, which is suitable for several words separated by Spaces, with the '. 'end, do you want to output the length of each word in the line of text, the word has nothing to do with language, can include various symbols, such as "it' s" count as one word, the length is 4, note that may emerge in the line of continuous Spaces,
CodePudding user response:
Input is the first program ". "after the end of cycle, then output the length of the S1 (not including". "), otherwise the output length of S1 + null character, and then continue to cycle, You this is to check whether the first a character in a as "" or". ", if the output is a - B, then B=a + 1, First of all, you are the only one keyboard input, can't be cycle, if enter a null character for the first time, your a. ength () may be zero; Moreover, the first is the ". "if you don't input, input infinitely print result; The only input "" or". "you didn't print the results Finally, the first printed as input characters, you print is zero,