#include "stdio.h"
struct student
{
long num;
float score;
struct student * next;
};
void main()
{
struct student stu1,stu2,stu3;
struct student * head,*p;
stu1.num=1;stu1.score=2;
stu2.num=2;stu2.score=2;
stu3.num=3;stu3.score=2;
head=&stu1;
stu1.next=&stu2;
stu2.next=&stu3;
stu3.next=NULL;
p=head;
while(p!=NULL){
printf("%d %d",p->num,p->score);
p=p->next;
}
}
快乐的时光
相关分类