当执行到 printf(“this is a good program,”); 时,“this is a good program,”被放到了缓冲区,但没有引起缓冲区进行刷新的条件,执行 sleep(5); 也是一样,当执行到 printf(“after 5 seconds.\n”); 时,“after 5 seconds.\n” 被放到了缓冲区,此时缓冲区为"this is a good program,after 5 seconds.\n",由于遇到了‘\n‘,缓冲区会进行刷新,将“this is a good program,after 5 seconds.”输出。