这个程序目的是回显之前输入的内容,包括空格。比如This is a book.回显内容就应该也是This is a book.但我写出来的程序回显的是Thisisabook.该怎么改呢?#include<iostream.h#include<malloc.htypedef struct node{ char data; struct node *next;}node,*Lstring; //结构体定义void creat(Lstring &s){ node *p1,*p2; s=(Lstring)malloc(sizeof(node)); //新建头结点 cout<<" 请输入字符串:"; p2=s; p1=p2; while(p1-data!='.') //建立链表 { p1=(Lstring)malloc(sizeof(node)); //新建首元结点 cinp1-data; p2-next=p1; p2=p2-next; } p1-next=NULL;}void main(){ struct node *p; Lstring a; creat(a); cout<<" 结果是:"; p=a-next; while(p!=NULL) { cout<data; p=p-next; } cout<<endl;}