#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define LEN sizeof(struct student)
struct student *creat();
void print(struct student *head)
struct student
{
int num;
double score;
struct stduent *next;
}
int n;
void main()
{
struct student *stu;
stu=creat();
print(stu);
printf("\n\n");
system("pause");
}
struct student *creat()
{
struct student *head;
struct student *p1,*p2;
p1=p2=(struct student *)malloc(LEN);
printf("please enter the num");
scanf("%d",&p1->sum);
printf("please enter the score");
scanf("%lf",&p1->score);
head=NULL;
n=0;
while(0!=p1->sum)
{
n++;
if(1==n)
{
head=p1;
}
else
p2->next=p1;
}
}
}