太自由

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
#include<stdio.h>
 
//定义结构体
struct Student
{
int num;
float score;
struct Student *next;
};
 
int main()
{
struct Student a,b,c,*head,*p;
a.num=101;a.score=89;
b.num=102;b.score=97;
c.num=103;c.score=85;
head=&a;
a.next=&b;
b.next=&c;
c.next=NULL;
p=head;
do
{
printf("%ld %5.1f\n",p->num,p->score);
p=p->next;
}while(p!=NULL);
return 0;
}

 

posted on 2015-09-11 18:20  太自由  阅读(263)  评论(0编辑  收藏  举报