ǰλãҳ > 《C语言程序设计》课程设计报?图书信息管理系统) - 百度文库
6ʱͻEnter the static(lognum bookname authorname scorenum publishname time price):ҪӵͼϢͿˡ 0ʱ˳
ַֻʱͻEnter error!
γܽ
ΪС鳤ҾƵijѾܹʵĿҪõļݡǣҾǵijǴһЩ֮ȽһļļչѾ涨õģǵļΪʱʱѡ6ǣᷢһʼҪѡ6,ѡвѯġɾܣϢҪļеһ£ʵ֣вͬͲʵЩˡ
⣬лҵԱΪǷֹģеĸһܣеĸܣҪЩǵĻ£ǺܿͰܳдãϡлǵϡΪǿģֻǵĻܹʱγơ
ҾγƵĹУѧ˺ܶණһģڵԳУƵijôߵʾ00棬ȴУнʱҾʱǿĵʱҲֻĺ֧ܵϣеѡУԹ˼ӵʱһֻǴһ塣ڶǹͨΪҶCҲȽˣһЩͬѧȽİңҽǵǣ̵˹ͨҪԣΪֻ㹵ͨĺã⣬Ҳ˷ѿȥһЩҪ֪ʶ㡭
ο룺
/*................................................................................................*/ #include
struct bookinf { //ṹ int num;
char bname[20]; char wname[10]; char clanum[14]; char pubcom[10]; char pubtime[10]; float price; struct bookinf *next; };
long size; FILE * fp;
struct bookinf * vitil(void) //ļó { struct bookinf * p1,* p2,* p3; int num;
char bname[20]; char wname[10]; char clanum[14]; char pubcom[10]; char pubtime[10]; float price; long i=0; if((fp=fopen(\.txt\ //ļ { printf(\.txt!\\n\ exit(0); } while(! feof(fp)) { if(feof(fp)) break; if(i>=1) p3=p1; if((p1=(struct bookinf *)calloc(1,size))==NULL) { printf(\
exit(1); }
fscanf(fp,\ p1->num=num; strcpy(p1->bname,bname); strcpy(p1->wname,wname); strcpy(p1->clanum,clanum); strcpy(p1->pubcom,pubcom); strcpy(p1->pubtime,pubtime); p1->price=price; if(i==0) p2=p1; else p3->next=p1; i++; } if(p2->next==p1) p2->next=NULL; else p3->next=NULL; free(p1); fclose(fp); //رļ return p2; }
void inputchoice(void) { printf(\ printf(\ printf(\ printf(\ printf(\ printf(\ printf(\ printf(\}
void write_to_txt(struct bookinf * head) //дļ { struct bookinf * p; if((fp=fopen(\.txt\
{ printf(\.txt!\\n\ exit(0); } for(p=head;p;p=p->next) { fprintf(fp,\m,p->pubtime,p->price);
} fclose(fp); }
/*......................................................ӹ...............................................*/ struct bookinf * Enter(struct bookinf * head) // { struct bookinf * p1,* p2,*p3; int num; char bname[20]; char wname[10]; char clanum[14]; char pubcom[10]; char pubtime[10]; float price; if((p1=(struct bookinf *)calloc(1,size))==NULL) { printf(\ exit(1); } printf(\the static(lognum bookname authorname scorenum publishname time price):\\n\
scanf(\ p1->num=num; strcpy(p1->bname,bname); strcpy(p1->wname,wname); strcpy(p1->clanum,clanum); strcpy(p1->pubcom,pubcom); strcpy(p1->pubtime,pubtime); p1->price=price; p2=head; if(head==NULL)
92ƪĵ