链表输出错误的一些问题

问题遇到的现象和发生背景

如图,想问问为什么不能输出

用代码块功能插入代码,请勿粘贴截图
#include 
#include 
#include 
typedef struct list{
    char elem;
    struct list* next;
}List;
void Input(List* L,int n)
{
    int i;
    for(i=0;imalloc(sizeof(List));
        printf("输入字符,按下回车读取:");
        scanf("%c",&(L->elem));
        getchar();
        L=L->next;
    }
}
void showList(List* L,int n)
{
    int i;
    for(i=0;iif(L->next==NULL)
        {
            fprintf(stderr,"error");
            exit(1);
        }
        printf("第%d 个字符%c\n",i,L->elem);
        L=L->next;
    }
}
int main()
{
    List LI;
    Input(&LI,7);
    printf("%c",LI.elem);
    showList(&LI,7);
    return 0;
}

运行结果及报错内容

例如输入a
a
a
a
不能输出