#include
#include
struct student {
char name;
int age;
int no;
struct student *next;
};
main() {
struct student create(void) {
struct student *p1,*p2,*head;
head = NULL;
p1 = p2 = (struct student)malloc(sizeof(struct student));
scanf("%c,%d,%d",p1->name,p1->age,p1->no);
while (p1->no != 0) {
if (p1->no == 1)
head = p1;
else
p2->next = p1;
p2 = p1;
p1 = (struct student*)malloc(sizeof(struct student));
scanf("%c,%d,%d",p1->name,p1->age,p1->no);
}
p2->next = NULL;
return head;
}
}