数学成绩英语成绩c语言,用链表输入一个正整数n,再输入n 个学生的学号和数学,英语,C语言成绩,要求...

#include /* 一个学生的信息 */

struct Student{

int id; // 学号

double m_grade; // 数学成绩

double E_grade; // 英语成绩

struct Student *next;

};

struct Student* create_st(){

struct Student* st = (struct Student*)malloc(sizeof(struct Student));

printf(" 请输入学号: ");

scanf("%d", &(st->id));

printf("请输入数学成绩: ");

scanf("%lf", &(st->m_grade));

printf("请输入英语成绩: ");

scanf("%lf", &(st->E_grade));

printf("一个学生信息输入完毕\n");

st->next = NULL;

return st;

}

/* 学生信息统计列表(单向链表) */

struct St_list{

struct Student *head; // 指向表头部的指针

struct Student *tail; // 指向表尾部的指针

int count; // 当前列表中一共有多少个学生信息

};

/* 初始化学生表 */

void init(struct St_list *sl){

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值