#include<stdio.h>
struct Student
{
int num;
float score;
struct Student *next;
};
int main()
{
struct Student a, b, c, *head, *p;
a.num = 1010;
a.score = 89.5;
b.num = 10103;
b.score = 90;
c.num = 10107;
c.score = 85;
head = &a;
a.next = &b;
b.next = &c;
c.next = NULL;
p = head;
while(p != NULL)
{
printf("%d %f\n",p->num, p->score);
p = p->next;
}
return 0;
}
struct Student
{
int num;
float score;
struct Student *next;
};
int main()
{
struct Student a, b, c, *head, *p;
a.num = 1010;
a.score = 89.5;
b.num = 10103;
b.score = 90;
c.num = 10107;
c.score = 85;
head = &a;
a.next = &b;
b.next = &c;
c.next = NULL;
p = head;
while(p != NULL)
{
printf("%d %f\n",p->num, p->score);
p = p->next;
}
return 0;
}