C语言程序设计(图书管理系统)源代码 倾情奉献

发布时间 : 星期日 文章C语言程序设计(图书管理系统)源代码 倾情奉献更新完毕开始阅读

# include< stdio.h > # include< string.h > # include< stdlib.h >

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ struct tushu_node{ int num; char leibie[20]; char name[30]; char author[20]; char press[20]; char time[20]; double price; struct tushu_node*next;};

FILE *fpp; /*定义fpp为全局变量*/ struct tushu_node*head,*tail,*p;

int quanxian(); /* 核查权限的函数 */ int inputchioce(); /* 显示主菜单的函数 */

void save(); /* 保存链表为文件的函数 覆盖以前的信息 */ void save1(); /* 保存链表为文件的函数 不覆盖以前的信息 只在创建时调用一次*/

struct tushu_node* wjtolb(); /* 从文件中读取数据并建立图书信息的链表的函数 */

int luruxinxi(); /* 录入学生信息的函数 */ struct tushu_node * luruxinxi_chuangjian(); /* 创建图书信息的函数 */ struct tushu_node * luruxinxi_charu(); /*插入图书信息的函数*/ struct tushu_node * luruxinxi_shanchu(); /*删除图书信息的函数*/ struct tushu_node * luruxinxi_xiugai(); /*修改图书信息的函数*/

int liulantushu(); /* 浏览图书信息的函数 */

int chaxuntushu(); /* 查询图书信息的函数 */ void chaxuntushu_num(); /* 按编号查询图书 */ void chaxuntushu_name(); /* 按书名查询图书 */ void chaxuntushu_price(); /* 按价格查询图书 */

void paixutushu(); /* 为图书排序的函数 */ struct tushu_node* paixutushu_price(); /* 为图书按价格排序的函数 */

struct tushu_node* paixutushu_time(); /* 为图书按出版时间排序的函数 */

void sfjx() ; /* 写个小函数,判断是否继续,让程序更完美 在排序中使用 */

int tongjitushu_shumu(); /* 统计图书数目的函数 */

void shiyongshuoming(); /* 使用说明的函数 */

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

int main() { int chioce;

chioce=quanxian(); /*核查用户是否有使用该管理系统的权限的函数*/ if(chioce==1) /*若取得权限 则返回值为1 */ { system(\ } exit(0); }

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

int inputchioce() /* 主菜单 */ { int mychioce,x=-1; printf(\欢 迎 你++++++++++++++++++++++++++++++++++\\n\\n\ printf(\主 菜 单

+++++++++++++++++++++++++++++++**\\n\

printf(\ 1-- 录入(删除 修改)图书信息 ** ** 2--(按规则)查询图书信息 **\\n\

printf(\ 3-- 浏览图书信息 ** ** 4-- 为图书(按规则)排序 **\\n\

printf(\ 5-- 统计图书(数目) ** ** 6-- 帮助 **\\n\ printf(\ 0-- 退出系统 ** ** **\\n\

printf(\++++++**\\n\

printf(\恭喜你获得使用权限,请你选择:\ scanf(\ switch(mychioce) { case 1: { luruxinxi();break;} case 2: {chaxuntushu();break;} case 3: { liulantushu();break;} case 4: { paixutushu();break;} case 5: { tongjitushu_shumu(); printf(\是否继续操作? 请选择(继续-1/退出-0)\ scanf(\

if(x==1){ system(\

if(x==0){printf(\谢谢你的使用! 再见\\n\ exit (0); } if(x!=1&&x!=0) {system(\ printf(\选择有误,默认返回主菜单,请重新选择:\\n\ inputchioce(); } break;} case 6: { shiyongshuoming();break;} case 0: { printf(\谢谢你的使用!!再见 \\n\\n\ default: { system(\ printf(\选择有误,请重新选择:\\n\

inputchioce(); }break; } }

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ int quanxian() { int m=1,n=3,flag=0; char mima[20]; do{ printf(\ 你好,欢迎使本图书信息管理系统!\\n\

printf(\~~~~~~~~~\\n\ printf(\【现在进行权限核查】 \\n--------------------友情提醒:你共有3次输入密码的机会!\\n\

printf(\~~~~~~~~~\\n \

if(n==2||n==1){printf(\注意:你已输入错误%d次 剩余输入次数: %d 请输入密码:\ if(n==3) printf(\剩余输入次数: %d 请输入密码:\ scanf(\ if(strcmp(mima,\ {flag=1; return flag; } m++; n--; system(\ }while(strcmp(mima,\

printf(\对不起,你连续三次输入密码错误,没有使用该图书管理系统的权限!\\n\ exit(0); }

联系合同范文客服:xxxxx#qq.com(#替换为@)