关于”c语言“的问题

头文件下
#include
#include
#include
typedef struct date
{
    int year;
    int month;
    int day;
}DATE;
typedef struct stu
{
    long stuID;     //学号
    char stuname[10];    //名字
    char stusex;     //性别
    DATE birthday;   //生日
    float aver;      //平均分
}STU;
typedef struct node
{
    STU stu;
    struct node* next;   //指向下一个节点的指针
}NODE;
NODE* head = NULL;  //头节点
void start();
void inputstudent();
源文件
#include"stu.h"
int main()
{
    while (1)
    {
        start();
        char ch = _getch();
        switch (ch)
        {
        case '1':  //录入学生信息
            inputstudent();
            break;
        case '2':  //打印学生信息
            break;
        case '3':  //保存学生信息
            break;
        case '4':  //读取学生信息
            break;
        case '5':  //按总分由高到低排出名次
            break;
        case '6':  //按总分由低到高排出名次
            break;
        case '7':  //按学号由小到大排出成绩表
            break;
        case '8':  //按姓名字典顺序排序排出成绩表
            break;
        case '9':  //根据学号查询学生成绩及排名
            break;
        case '0':  //根据姓名查询学生成绩及排名
            break;
        case '00':  //退出系统
            break;
        }
    }
    return 0;
}
void start()
{
        printf("*****************************************\n");
        printf("欢迎使用学生成绩管理系统        *\n");
        printf("*1.录入学生信息                *\n");
        printf("*2.打印学生信息                *\n");
        printf("*3.保存学生信息                *\n");
        printf("*4.读取学生信息                *\n");
        printf("*5.按总分由高到低排出名次        *\n");
        printf("*6.按总分由低到高排出名次        *\n");
        printf("*7.按学号由小到大排出成绩表        *\n");
        printf("*8.按姓名字典顺序排序排出成绩表        *\n");
        printf("*9.根据学号查询学生成绩及排名        *\n");
        printf("*0.根据姓名查询学生成绩及排名        *\n");
        printf("*00退出系统                        *\n");
        printf("*****************************************\n");
        getchar();
}
void inputstudent()
{
    NODE* newnode =(NODE*)malloc(sizeof(node)); //创建头结点,使newnode这个指针可以通过->来当作结构体变量来用
    newnode->next = NULL;
    if (head == NULL)
    {
        head = newnode;
    }
    else
    {
        newnode->next = head;
        newnode = head;
    }
        printf("学号:");
        scanf_s("%ld", &newnode->stu.stuID);
        printf("姓名:");
        scanf_s("%s", newnode->stu.stuname);
        printf("性别:");
        scanf_s("%c", &newnode->stu.stusex);
        printf("年:");
        scanf_s("%d", &newnode->stu.birthday.year);
        printf("月:");
        scanf_s("%d", &newnode->stu.birthday.month);
        printf("日:");
        scanf_s("%d", &newnode->stu.birthday.day);
}

img


执行的时候卡到性别那里不动了,怎么回事?

录入函数修改如下,改动处见注释,供参考:

void inputstudent()
{
    NODE* newnode =(NODE*)malloc(sizeof(node)); //创建头结点,使newnode这个指针可以通过->来当作结构体变量来用
    newnode->next = NULL;
    if (head == NULL)
    {
        head = newnode;
    }
    else
    {
        newnode->next = head;
        head = newnode; //newnode = head;  修改
    }
        printf("学号:");
        scanf_s("%ld", &newnode->stu.stuID);
        printf("姓名:");
        scanf_s("%s", newnode->stu.stuname,10); //修改
        printf("性别:");
        scanf_s(" %c", &newnode->stu.stusex,1);  //修改
        printf("年:");
        scanf_s("%d", &newnode->stu.birthday.year);
        printf("月:");
        scanf_s("%d", &newnode->stu.birthday.month);
        printf("日:");
        scanf_s("%d", &newnode->stu.birthday.day);
}

https://ask.csdn.net/questions/7609455?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522167730384816800188591713%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fask.%2522%257D&request_id=167730384816800188591713&biz_id=4&utm_medium=distribute.pc_search_result.none-task-ask_topic-2~ask~first_rank_ecpm_v1~ask_rank-2-7609455-null-null.pc_ask&utm_term=%E6%88%90%E7%BB%A9%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F&spm=1018.2226.3001.4187