用C语言结构体指针编程序实现输入十个学生的学号,期中和期末成绩,计算输出成绩表和学生平均分
来源:百度知道 编辑:UC知道 时间:2024/06/19 07:20:49
这么菜的问题也有,把网络当作义务为你打工的了。
#include<iostream>
#include<string>
using namespace std;
//=============<开始定义结构体>===================================================
struct combox{
int num;
int mark;
string name;
combox *next;
};
//=============<结束定义结构体>===================================================
//=============<开始定义Commonbox类>==============================================
//-----类体开始------------------------
class Commonbox{
private:
combox *head;
void Swap(combox *,combox *); //交换两个combox变量的数据域
void Print(combox *); //输出一combox指定的记录
combox *Find(int); //查找条例条件的记录,并返回该记录的指针
public:
Commonbox(){head=NULL;}
int ListCount(); //统计当前链表的记录总数,返回一个整数
void AddItem(int num, string name, int mark); //添加一条记录到表尾
void RemoveItem(int); //删除一条指定的记录
void List(); //列出当前链表中的所有记录
void