#include <stdlib.h>
#include <stdio.h>
typedef struct schedule{
struct schedule *next;
int day;
//int hasNext;
char title[100];
}SCHEDULE;
SCHEDULE *now,*sch;
int main(){
sch = 0;
now = sch;
int continuebool=1;
while(continuebool)
{
int wkday = 0;
if(wkday == 0)
{
continuebool = 0;
}
else
{
SCHEDULE
*wk
= (SCHEDULE
*)malloc(sizeof(SCHEDULE
)); wk->day = wkday;
wk->next = 0;
printf("\nType title(char*):"); if(sch == 0)
{
sch = wk;
now = sch;
}
else
{
now->next = wk;
now = wk;
}
}
}
now = sch;
while(now)
{
printf("\nday:%d\n",now
->day
); printf("title:%s\n",now
->title
); SCHEDULE *old = now;
now = now->next;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGxpYi5oPgojaW5jbHVkZSA8c3RkaW8uaD4KCnR5cGVkZWYgc3RydWN0IHNjaGVkdWxlewoJc3RydWN0IHNjaGVkdWxlICpuZXh0OwoJaW50IGRheTsKCS8vaW50IGhhc05leHQ7CgljaGFyIHRpdGxlWzEwMF07Cn1TQ0hFRFVMRTsKClNDSEVEVUxFICpub3csKnNjaDsKCmludCBtYWluKCl7CglzY2ggPSAwOwoJbm93ID0gc2NoOwoJaW50IGNvbnRpbnVlYm9vbD0xOwoJd2hpbGUoY29udGludWVib29sKQoJewoJCWludCB3a2RheSA9IDA7CgkJcHJpbnRmKCJcblR5cGUgZGF5KGludCk6Iik7CgkJc2NhbmYoIiVkIiwmd2tkYXkpOwoJCWlmKHdrZGF5ID09IDApCgkJewoJCQljb250aW51ZWJvb2wgPSAwOwkKCQl9CgkJZWxzZQoJCXsKCQkJU0NIRURVTEUgKndrID0gKFNDSEVEVUxFKiltYWxsb2Moc2l6ZW9mKFNDSEVEVUxFKSk7CgkJCXdrLT5kYXkgPSB3a2RheTsKCQkJd2stPm5leHQgPSAwOwoJCQlwcmludGYoIlxuVHlwZSB0aXRsZShjaGFyKik6Iik7CgkJCXNjYW5mKCIlcyIsd2stPnRpdGxlKTsKCQkJaWYoc2NoID09I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