|
[code:1]
#include <stdio.h>
struct student
{
long num;
float score;
struct student *next;
};
int main()
{
struct student a, b, c, *next, *p;
a.num = 99101; a.score = 89.5;
b.num = 99103; b.score = 90;
c.num = 99107; 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);
}
[/code:1] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
×
|