程序代码:
#include <stdio.h> #include <stdbool.h> #include <ctype.h> int main(void) { char c; bool flag = false; while ((c = getchar()) != EOF) { if (isspace(c)) { if (flag) { putchar('\n'); } flag = false; } else { putchar(c); flag = true; } } return 0; }
===
跟楼上差不多
Read The Fucking Source Code~