b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

以纯C语言编写的图书馆管理系统,要求链接列表,乞求

电脑杂谈  发布时间:2020-03-28 04:09:03  来源:网络整理

c语言编写网站流量分析系统_用c语言编写的图书管理系统_c语言编写万年历系统

//不是很严格. 您可以自己擦亮. 如果您了解问题所在用c语言编写的图书管理系统,请赐教. 我也是新人. #include #include #include #include #include #include typedef struct book_type {int NO _; //图书编号char名称[50]; //命名为char作者[50]; //作者int num; //这个数字struct book_type * next; struct book_type * pre;} book; book * book_end,* book_first; //定义列表的第一个和最后一个/ ******** ******************重复操作*********** **************** / int再次()//返回0不会重复{char go_on; printf(“是否要继续?Y(y)/ N(n): ”); fflush(stdin); scanf(“%c”,&go_on); while(go_on!='y'&& go_on!='Y'&& go_on!='N'&& go_on!='n')// {printf(“输入错误,请重新输入: ”); fflush(stdin); scanf(“%c”,&go_on);}如果(go_on =='N'|| go_on =='n')返回0;否则返回1;} / **************** **********添加书籍**************** *********** / void add_book(){system(“ cls”); printf(“ \ t \ t \ t \ t添加书籍\ t \ t \ t \ t \ n”); int标志;书*临时;做{temp =(book *)malloc(sizeof(book)); if(temp == NULL){cout <<“无法分配空间!清除内存空间,然后重试.

c语言编写万年历系统_c语言编写网站流量分析系统_用c语言编写的图书管理系统

“ << endl; //使用printf,scanf很麻烦,请原谅我退出(0);中断;} cout <<”请输入书号: “; cin >> temp-> NO _; //如果您知道输入类型的正确性,请添加QQ365385495. 谢谢cout <<“请输入书名: ”; cin >> temp->名称; cout <<“请输入作者名: ”; cin> > temp-> author; cout <<“请输入书数: ”; cin >> temp-> num; if(book_end == NULL){temp-> next = temp; temp-> pre = temp; book_first = temp; book_end = temp;}否则{temp-> pre = book_end; temp-> next = book_first; book_end-> next = temp; book_first-> pre = temp; book_end = temp;}标志=再();} while(flag == 1); // cout << book_first-> pre-> pre-> NO _ << endl; system(“ Pause”);} / ************* ****** *******删除图书*************************** / void del_book(){system( “ cls”); printf(“ \ t \ t \ t \ t添加book \ t \ t \ t \ t \ t \ n”); int标志,i; int节点; book * temp; do {temp = book_first; cout <<“请删除节点号: ”; cin >>节点; if(temp == NULL){cout <<“没有预订信息” << endl;打破; //退出(0);}否则{while(node <1){cout <<“输入错误!重新输入” << endl; cin >> node;} for(i = 1; i 接下来; if(temp == book_first){cout <<“没有这样的节点” < pre-> next = temp-> next; temp-> next-> pre = temp-> pre;如果(节点== 1)book_first = temp-> next;免费(temp);标志=再一次();}),而(标志== 1); // cout << book_first-> pre-> pre-> NO _ << endl;系统(“暂停”);} / **** **********************查询图书************* ************* * / void ind_book(){system(“ cls”); printf(“ \ t \ t \ t \ t查询书籍\ t \ t \ t \ t \ n”);书*临时; temp = book_first; if(temp == NULL)cout <<“没有图书新闻” NO _ <<“”“ <<”书名: “ << temp->名称<<”“” <<“ Books OF: ” << temp->作者<<“” << <<标题数: “ << temp-> num << endl; temp = temp-> next;} while(temp!= book_first);系统(“暂停”);} / **************************借用书******** ***** ************** /无效借用(){system(“ cls”); printf(“ \ t \ t \ t \ t借用书\ t \ t \ t \ t \ n”);整数标志,我; char book_name [50];书*临时;做{temp = book_first; cout <<“请输入您要借书的名称: ”; cin >> book_name; if(temp == NULL){cout <<“没有书本信息” 用c语言编写的图书管理系统,temp-> name)&& temp-> next!= book_first)temp = temp-> next; if(strcmp(book_name,temp-> name))cout <<“没有这样的书” << endl;否则{if(temp(>-num> 0)temp-> num- = 1;否则cout <<“这本书缺货” << endl;}} flag = again();} while(flag == 1); / cout << book_first-> pre-> pre-> NO _ << endl;系统(“暂停”);} / **************************返回书*********** ** ************** / void ret(){system(“ cls”); printf(“ \ t \ t \ t \ t借用书\ t \ t \ t \ t \ n”);整数标志,我; char book_name [50];书*临时;做{temp = book_first; cout <<“,请输入返回的书的名称: ”; cin >> book_name; if(temp == NULL){cout <<“ No book news” << endl; //退出(0);}否则{while(strcmp(book_name,temp-> name)&& temp-> next!= Book_first)temp = temp-> next; if(strcmp(book_name,temp-> name))cout <<“没有这样的书” << endl;否则temp-> num + = 1;}标志=再次();} while(标志== 1); // cout << book_first-> pre-> pre-> NO _ << endl;系统(“暂停”);} / ********************** ****主要功能************* ************** / int main(){int flag;动作book_first = book_end = NULL;而(1){system(“ cls”); printf(“ \ t \ t / *****这是一个图书馆系统****** / \ t \ t \ t \ n”); printf(“ \ t \ t \ t1. 添加书籍\ t \ t \ t \ n”); printf(“ \ t \ t \ t2. 删除Books \ t \ t \ t \ n”); printf(“ \ t \ t \ t3. 检查书籍\ t \ t \ t \ n”); printf(“ \ t \ t \ t4. 借用书\ t \ t \ t \ t \ n”); printf(“ \ t \ t \ t5. 退货书\ t \ t \ t \ t \ n”); printf(“ \ t \ t \ t0. 退出程序\ t \ t \ t \ n”); printf(“请输入您的操作: ”);做{flag = 0; fflush(stdin); scanf(“%d”,&action);开关(动作){情况1: add_book();打破;情况2: del_book();打破;情况3: ind_book();打破;情况4: 借用();打破;情况5: ret();打破;情况0: 退出(0);打破;默认值: flag = 1; printf(“输入错误,请重新输入: ”);}} while(flag);}}


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-154932-1.html

    相关阅读
      发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

      热点图片
      拼命载入中...