CodePudding user response:
Pour the images with hair, is the biggest mistakeAre you going to let the person help you backwards?
CodePudding user response:
Ah ~ ~ follow that way just write ah ~ ~ where is wrong yourself to ~
# include & lt; Stdio. H>
# include & lt; Ctype. H>
Int main () {
Char a, [81].
Int the word=0;
Int count=0;
Gets (a);//read in line with the gets ();
for(int i=0; A [I]!='\ 0'; I++) {
If (isalpha (a [I]))//if it's letters,
The word=1;//represents a new words
Else if (isspace (a [I]) & amp; & The word==1) {
Count++;//run into the space behind the words, word + 1;
The word=0;//marks reset ~
}
}
If (word==1) count++;//the last word ~
Printf (" % d a word \ n ", count);
return 0;
}
CodePudding user response:
Int I=strlen (int) (a) + 1;//note the brackets here, otherwise a is an array, not + 1In fact you this in less than, it is not necessary to calculate strlen