此过程称为回显输入。它使用while循环,在遇到#字符时终止。
while
#
#include <stdio.h> int main(void) { char ch; while ((ch = getchar()) != '#') putchar(ch); return 0; }