//链表节点
typedef struct Node*{
    char elem;
    struct Node* next;
};
//创建单链表
Node* CreateList(Node* head){
    if(NULL == head){
        head = (Node*)malloc(sizeof(Node));
        head->next = NULL;
    }
    Node* current = head,*temp;
    char ch;
    while((ch = getchar())!= '#'){
        temp = (Node*)malloc(sizeof(Node));
        temp->elem = ch;
        temp->next = NULL;
        current->next = temp;
        current = temp;
    }
    return head;
}