#include <stdlib.h>
#include <stdio.h>
typedef struct schedule{
struct schedule *next;
int day;
//int hasNext;
char title[100];
}SCHEDULE;
int main(){
SCHEDULE
*now
,*sch
=(SCHEDULE
*)malloc(sizeof(SCHEDULE
)); int continuebool=1;
now=sch;
while(continuebool){
if(continuebool){
//now->hasNext =1;
now
->next
=(SCHEDULE
*)malloc(sizeof(SCHEDULE
)); now =now->next;
}
now->next = NULL;
}
now = sch;
while(now){
printf("\nday:%d\n",now
->day
); printf("title:%s\n",now
->title
); now = now->next;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGxpYi5oPgojaW5jbHVkZSA8c3RkaW8uaD4KCnR5cGVkZWYgc3RydWN0IHNjaGVkdWxlewoJc3RydWN0IHNjaGVkdWxlICpuZXh0OwoJaW50IGRheTsKCS8vaW50IGhhc05leHQ7CgljaGFyIHRpdGxlWzEwMF07Cn1TQ0hFRFVMRTsKCmludCBtYWluKCl7CglTQ0hFRFVMRSAqbm93LCpzY2g9KFNDSEVEVUxFKiltYWxsb2Moc2l6ZW9mKFNDSEVEVUxFKSk7CglpbnQgY29udGludWVib29sPTE7Cglub3c9c2NoOwoKCXdoaWxlKGNvbnRpbnVlYm9vbCl7CgkJcHJpbnRmKCJcblR5cGUgZGF5KGludCk6Iik7c2NhbmYoIiVkIiwmbm93LT5kYXkpOwoJCXByaW50ZigiXG5UeXBlIHRpdGxlKGNoYXIqKToiKTtzY2FuZigiJXMiLG5vdy0+dGl0bGUpOwoJCXByaW50ZigiXG5jb250aW51ZSgxLzApOiIpO3NjYW5mKCIlZCIsJmNvbnRpbnVlYm9vbCk7CgkJaWYoY29udGludWVib29sKXsKCQkJLy9ub3ctPmhhc05leHQgPTE7CgkJCW5vdy0+bmV4dCAgICA9KFNDSEVEVUxFKiltYWxsb2Moc2l6ZW9mKFNDSEVEVUxFKSk7CgkJCW5vdyAgICAgICAgICA9bm93LT5uZXh0OwoJCX0KCQlub3ctPm5leHQgPSBOVUxMOwoJfQoJbm93ID0gc2NoOwoJd2hpbGUobm93KXsKCQlwcmludGYoIlxuZGF5OiVkXG4iLG5vdy0+ZGF5KTsKCQlwcmludGYoInRpdGxlOiVzXG4iLG5vdy0+dGl0bGUpOwoJCW5vdyA9IG5vdy0+bmV4dDsKCX0KCXNjYW5mKCIlZCIpOwoJcmV0dXJuIDA7Cn0=