#include <iostream>
using namespace std;
struct Student{
int num;
float score;
Student *next;
};
int main() {
Student a, b, c, *head, *p;
void student(Student *pstu,int num, float score);
void student_to_String(Student *pstu);
head = &a;
a.next = &b;
b.next = &c;
c.next = NULL;
p = head;
int i = 0, j = 3;
do{
student(p,1001 + i, 80.0 + j * i);
p = (*p).next;
i ++;
}while(p != NULL);
p = head;
do{
student_to_String(p);
p = (*p).next;
}while(p != NULL);
return 0;
}
void student(Student *pstu, int num, float score){
Student *stu;
stu = pstu;
(*stu).num = num;
(*stu).score = score;
printf("学生节点构造完毕!\n");
}
void student_to_String(Student *pstu){
Student *stu;
stu = pstu;
printf("---------*****---------\n");
printf("该节点的信息如下:\n");
printf("该同学的学号为:%d\n", (*stu).num);
printf("该同学的分数为:%3.2f\n", (*stu).score);
printf("该节点信息输出完毕!\n");
}