为什么有时候只输出10.2,有时候是10.2 0.0

问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果
#include<stdio.h>
#include <malloc.h>
typedef struct Node
{
    char instruct[10];
    long int num;    //学号
    char name[20];  //姓名
    char sex[2];    //性别
    double chinese; //语文
    double math;    //数学
    double english; //英语
    struct Node* next;
} PolyNode, * PolyList;

PolyList createList(){
    PolyList L;
    L = (PolyList)malloc(sizeof(PolyList));
    L->next = NULL;

    return L;
}

void insertTail(PolyList L,double math) {
    Node* p = L->next;
    PolyList s,pre = L;
    s = (PolyList)malloc(sizeof(PolyList));
    while (p != NULL) {
        pre = p;
        p = p->next;
    }
    s->math = math;
    pre->next = s;
}

void printList(PolyList L) {
    Node* p = L->next;
    while (p != NULL) {
        printf("%.1lf ",p->math);
        p = p->next;
    }
}

int main() {
    char a[10];
    PolyList L;
    L = (PolyList)malloc(sizeof(PolyList));
    L->next = NULL;
    insertTail(L, 10.2);
    printList(L);
}

img

L = (PolyList)malloc(sizeof(PolyList));
改为
L = (PolyList)malloc(sizeof(PolyNode));
你要申请的是PolyNode结构体大小空间,但PolyList是个指针,只能申请4个字节空间
17、26行都是这样