我很难理解标有“线”的线:-
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<ctype.h>
int main(void)
{
char s[81], word[81];
int n= 0, idx= 0;
puts("Please write a sentence:");
fgets(s, 81, stdin);
while ( sscanf(&s[idx], "%s%n", word, &n) > 0 ) //line
{
idx += n;
puts(word);
}
return 0;
}
我可以将标有“行”的行替换为以下内容:
while ( sscanf(&s[idx], "%s%n", word, &n) )