d->ps=b=(struct setting*)malloc(sizeof(struct setting)*n);????这相当于给ps分配了n个setting连续的空间
scanf("%ld",&(*d).time);???scanf("%ld",&(d->time));
scanf("%d",&((*d).ps)->money);???scanf("%d",&(d->ps->money));这好看点吧!!
(d->ps)->next=(struct setting*)malloc(sizeof(struct setting)*n);给setting的next也分配n个空间??
d->ps=(struct setting*)malloc(sizeof(struct setting)*n);已经分配了,还要再分配??
总之你的程序让人费解!!!
要练习算法就来http:///!!有挑战哦!!