#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->hasNext=0;
}
while(sch->hasNext){
printf("\nday:%d\n",now
->day
); printf("title:%s\n",now
->title
); sch=sch->next;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGxpYi5oPgojaW5jbHVkZSA8c3RkaW8uaD4KCnR5cGVkZWYgc3RydWN0IHNjaGVkdWxlewoJc3RydWN0IHNjaGVkdWxlICpuZXh0OwoJaW50IGRheTsKCWludCBoYXNOZXh0OwoJY2hhciB0aXRsZVsxMDBdOwp9U0NIRURVTEU7CgppbnQgbWFpbigpewoJU0NIRURVTEUgKm5vdywqc2NoPShTQ0hFRFVMRSopbWFsbG9jKHNpemVvZihTQ0hFRFVMRSkpOwoJaW50IGNvbnRpbnVlYm9vbD0xOwoJbm93PXNjaDsKCgl3aGlsZShjb250aW51ZWJvb2wpewoJCXByaW50ZigiXG5UeXBlIGRheShpbnQpOiIpO3NjYW5mKCIlZCIsJm5vdy0+ZGF5KTsKCQlwcmludGYoIlxuVHlwZSB0aXRsZShjaGFyKik6Iik7c2NhbmYoIiVzIixub3ctPnRpdGxlKTsKCQlwcmludGYoIlxuY29udGludWUoMS8wKToiKTtzY2FuZigiJWQiLCZjb250aW51ZWJvb2wpOwoJCWlmKGNvbnRpbnVlYm9vbCl7CgkJCW5vdy0+aGFzTmV4dCA9MTsKCQkJbm93LT5uZXh0ICAgID0oU0NIRURVTEUqKW1hbGxvYyhzaXplb2YoU0NIRURVTEUpKTsKCQkJbm93ICAgICAgICAgID1ub3ctPm5leHQ7CgkJfQoJCW5vdy0+aGFzTmV4dD0wOwoJfQoKCXdoaWxlKHNjaC0+aGFzTmV4dCl7CgkJcHJpbnRmKCJcbmRheTolZFxuIixub3ctPmRheSk7CgkJcHJpbnRmKCJ0aXRsZTolc1xuIixub3ctPnRpdGxlKTsKCQlzY2g9c2NoLT5uZXh0OwoJfQoJcmV0dXJuIDA7Cn0=