int main (){char x;node*head,*s;int n=0;head=NULL;x=getchar ();1221053while(x!='#”){ s=(node *)malloc(sizeof(node));s->data=x; s->next=head; head=s;n++;x=getchar();}return 0;}
用头插法,将输入的字符添加到链表上,遇到#的时候停止输入