#include"iostream"
#include"stdlib.h"
#include"process.h"
#include"time.h"
using namespace std;
typedef struct Stu {
int id;
double score;
Stu *next;
};
struct Teacher {
int id;
string name;
Teacher *next;
};
void createList(Stu *&sl) { //带有头节点的单链表初始化其头节点
sl=(Stu*)malloc(sizeof(Stu));
sl->next=NULL;
cout<<"Success to initiate"<<endl;
}
void addNode(Stu *sl,int idtmp) { //尾插法建立带有头节点的单链表
Stu *node=(Stu*)malloc(sizeof(Stu));
double scoretmp=100.0*(double)rand()/RAND_MAX;//随机生成0-100的随机浮点数
node->next=NULL;
node->id=idtmp;
node->score=scoretmp;
S

最低0.47元/天 解锁文章
3907

被折叠的 条评论
为什么被折叠?



