65,202
社区成员




int n;
scanf("%d", &n); //这里接受一个n后下面的s第一次length = 0,输出是空行.
while(gets(s) != NULL) //返回NULL
{
printf("length: %d\n", strlen(s));
printf("%s\n", s);
}
int n;
//scanf("%d", &n); //去掉这句后下面的gets(s)为何每次的回车就不会接受?
while(gets(s) != NULL) //返回NULL
{
printf("length: %d\n", strlen(s));
printf("%s\n", s);
}
char s[20] = "";
int n;
scanf("%d", &n);
fflush(stdin);//加上这一行,就清空换行符了
while(gets(s) != NULL) //返回NULL
{
printf("length: %d\n", strlen(s));
printf("%s\n", s);
}