#include <iostream>
#define NULL 0
using namespace std;
struct Student
{
long num;
float score;
struct Student *next;
};
int main()
{
Student a,b,c,*head,*p;
a.num=30001;a.score=98;
b.num=30002;b.score=95;
c.num=30003;c.score=100;
head=&a;
a.next=&b;
b.next=&c;
c.next=NULL;
p=head;
do
{
cout<<p->num<<" "<<p->score<<endl;
p=p->next;
}while(p!=NULL);
return 0;
}
![](https://ucc.alicdn.com/notfound.png?x-oss-process=image/resize,w_1400/format,webp)
本文转自 韬光星夜 51CTO博客,原文链接:http://blog.51cto.com/xfqxj/477108,如需转载请自行联系原作者