「行」でマークされた行を理解するのが難しい:-
#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) )