int main(){ char* buf = NULL; //动态分配 //char buf[1024]; //指定长度 char ch;int len = 0,i;printf("Please input some line:\n");while(scanf("%c",&ch)==1 && ch!=EOF && ch!='#'){ //定义一个结束符或者ctrl+z/d //动态的实现 buf = (char*)realloc(buf,s...