#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;
stu2.num=2;
stu3.num=3;
head=&stu1;
stu1.next=&stu2;
stu2.next=&stu3;
stu3.next=NULL;
//p=head不用p不是也可以吗,p有什么用
while(head!=NULL){
printf("%d\n",head->num);
head=head->next;
}
}
望远
AIxer
相关分类