C语言图书信息管理系统,具体操作包括图书信息的录入、添加、显示、查找、删除、排序和保存等功能。

作者&投稿:鞠爸 (若有异议请与网页底部的电邮联系)
跪求C语言图书信息管理系统的程序。要求有删除图书信息、修改图书信息、查询、录入等功能1~

我是在校大学生,我有计算机的很多资料,包括C语言图书管理系统,加QQ526045428聊

#include
#include
#include
#include
#include
#define STACK_INIT_SIZE 10
#define OK 1
#define TRUE 1
#define FALSE 0
#define ERROR 0

struct student /*定义学生类型,用于存放借出的书籍*/
{
int carnum;
char lendbook[10];
}student[1000];

struct employ /*定义职工类型*/
{
int employnum;
char employname[15];
int employage;
char employsex[2];
char employleve[10];
long int employtage;
}employ[50];

struct book /*定义书的类型*/
{
int booknum;
char bookname[10];
char bookcreat[10];
int turefalse; /*用于借书和还书模块判断一本书是否借出的条件*/
}book[1000];

struct car /*借书卡的数据类型*/
{
int carnum;
char studentname[10];
int studentclass;
}car[100];

huanbook() /*还书函数*/
{
FILE *fp,*fp2; /*定义两个文件指针,fp2用于修改数据时设立临时文件用,防止数据遭破坏*/
int i,n;
int carnum;
char lendbook[10];
printf("请你输入你的卡号
");
scanf("%d",&carnum);
fp=fopen("car.txt","r"); /*读取卡号记录*/
for(i=0;fread(&car[i],sizeof(struct car),1,fp)!=0;i++) /*for循环判断卡号是否存在*/
{
if(car[i].carnum==carnum) /*卡号存在,进入下一循环*/
{
n=i;
fclose(fp);
printf("请输入你要还的书的名字
");
scanf("%s",lendbook);
fp=fopen("record.txt","r");
for(i=0;fread(&student[i],sizeof(struct student),1,fp)!=0;i++) /*判断是否借阅了输入的书*/
{
if(strcmp(student[i].lendbook,lendbook)==0) /*借阅了该书,进入下一循环,否则出错显示*/
{
fclose(fp);
fp=fopen("record.txt","r");
fp2=fopen("bookl.txt","w");
for(i=0;fread(&student[i],sizeof(struct student),1,fp)!=0;i++)
{
if(strcmp(student[i].lendbook,lendbook)==0)
{
continue; /*删除还掉的书的借书记录*/
}
fwrite(&student[i],sizeof(struct student),1,fp2); /*写入原来没还的书的记录*/
}
fclose(fp);
fclose(fp2);
fp=fopen("record.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(&student[i],sizeof(struct student),1,fp2)!=0;i++)
{
fwrite(&student[i],sizeof(struct student),1,fp); /*将借书记录信息写回*/
}
fclose(fp);
fclose(fp2);
fopen("bookl.txt","w"); /*清临时文件的记录*/
fclose(fp2);
fp=fopen("book.txt","r");
fp2=fopen("bookl.txt","w");
for(i=0;fread(&book[i],sizeof(struct book),1,fp)!=0;i++) /*将书的记录写入临时文件,防止因为修改信息破坏以前的记录*/
{
if(i==n)
{
book[i].turefalse=1;
fwrite(&book[i],sizeof(struct book),1,fp2); /*将还的书的原来状态设为无人借阅的*/
continue;
}
fwrite(&book[i],sizeof(struct book),1,fp2);
}
fclose(fp);
fclose(fp2);
fp=fopen("book.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(&book[i],sizeof(struct book),1,fp2)!=0;i++)
{
fwrite(&book[i],sizeof(struct book),1,fp); /*将临时文件写回*/
}
fclose(fp);
fclose(fp2);
fopen("bookl.txt","w"); /*清临时文件*/
fclose(fp2);
printf("还书完毕,按任意键返回
");
getch();
return 1;
}
}
printf("你没有借这样的书,任意键返回
"); /*出错提示*/
fclose(fp);
getch();
return 0;
}
}
printf("系统没这样的卡,和管理员联系,按任意键返回
"); /*出错提示*/
fclose(fp);
getch();
}

findbook()
{
FILE *fp;
char bookname[10];
int ture,i;
fp=fopen("book.txt","r");
printf("请输入你要查找的书名
");
scanf("%s",bookname);
for(i=0;fread(&book[i],sizeof(struct book),1,fp)!=0;i++)
{
if(strcmp(bookname,book[i].bookname)==0)
{
if(book[i].turefalse==1)
{

#include <cstring>

#include <vector>

#include <fstream>

#include <map>

#include <iostream>

#include <algorithm>

using namespace std;

class Library{

map<string,string> book_num;

vector<string> people_num;

map<string,string>::iterator ib;

vector<string>::iterator ip;

public:

Library(){

ib=book_num.begin();

ip=people_num.begin();

}

void set_book_num(string,string);

void delete_book_num(string);

void find_book_num(string);

void change_booke_num(string,string);

void add_people_num(string);

void lend_num(string,string);

void return_num(string,string);

void file_book(vector<string>::iterator);

void file_people(vector<string>::iterator);

};

void Library::set_book_num(string A,string B){

book_num.insert(A,B);

}

void Library::add_people_num(string A){

people_num.push_back(A);

}

void Library::find_book_num(string A){

map<string,string>::iterator result =find(book_num.begin(), book_num.end(), A);

if(result==book_num.end())

cout<<"图书馆中查无此书!"<<endl;

else

cout<<"图书馆中此书信息如下:"<<endl;

cout<<result->first<<":"<<result->second<<endl;

}

void Library::delete_book_num(string A){

map<string,string>::iterator result =find(book_num.begin(), book_num.end(), A);

if(result==book_num.end())

cout<<"图书馆中查无此书!"<<endl;

else

book_num.erase(result);

cout<<"已成功删除该书在图书馆中的记录"<<endl;

}

void Library::change_booke_num(string A,string B){

map<string,string>::iterator result =find(book_num.begin(), book_num.end(), A);

if(result==book_num.end())

cout<<"图书馆中查无此书!"<<endl;

else

result->second=B;

}

void Library::file_people(vector<string>::iterator ifp){

ofstream file_p;

file_p.open("/Users/apple/Documents/Library_p.txt",ios::out);

if(!file_p.is_open())

{

cerr<<"open file_people fail"<<endl;

exit(-1);

}

file_p<<*ifp<<endl;

file_p.close();

}

void Library::file_book(vector<string>::iterator ibp){

ofstream file_b;

file_b.open("/Users/apple/Documents/Library_b.txt",ios::out);

if(!file_b.is_open())

{

cerr<<"open file_people fail"<<endl;

exit(-1);

}

file_b<<*ibp<<endl;

file_b.close();

}





用C语言设计一个图书管理系统(高手请进)
我写的,基本符合你最基本的要求,不知道合适不合适,自己没有电脑,这些代码还是在网吧写的...在TC2.0调试通过的:include <stdio.h> include <stdlib.h> include <string.h> define NUM 100 struct book { char booknum[8];char bookname[15];char author[12];char PubHouse[15];char Pub...

一个简单的图书管理系统,C语言
printf("===大学信息管理系统===\\n");printf("---\\n");printf("1:办公室管理 5:财务管理\\n");printf("2:教务管理 6:图书管理\\n");printf("3:科研管理 7:设备管理\\n");printf("4:人事管理 8:后勤管理\\n");printf(" 0:退出系统\\n");printf("---\\n");printf(...

c语言图书管理系统代码,一定要能运行!!急!!详细要求在补充里~~,谢谢...
include "stdio.h"include<graphics.h> include "conio.h"include<stdlib.h> include<string.h> void main(){void adm1(),adm2(),build(),huan(),borrow(),dele();adm1();} void adm1(){ FILE *fp,*p ;char adp[20],password[20];int i,n=0;textbackground(2);clrscr();gotoxy...

求图书馆管理系统程序(c语言)
("\\t\\t4 图书信息删除\\n"); printf("\\t\\t5 图书信息排序\\n"); printf("\\t\\t6 提供游客和管理员两种登陆方式\\n"); printf("\\t\\t 加以修改可以满足网络的需要\\n\\n"); printf("\\t\\t7 管理员的帐号密码可以自我设定,修改\\n"); printf("\\t\\t8 彩蛋~~(进入方法嘛,嘿嘿)\\n"); printf("\\n\\...

用C语言编写的"图书馆管理系统"的源代码,删减版
用C语言编写的"图书馆管理系统"的源代码,删减版 70 图书馆管理系统:1Registernewsbooks登记一本书2listallregisteredbooks列出所有登记过的书3borrowabook借本书4listoflendings(allborrowedbooks).列出所有借出的书5removingbooks删一... 图书馆管理系统: 1 Register news books 登记一本书 2 list all registered...

求一个用c语言链表与文件编写的图书管理系统或者学生信息系统代码加流程...
include <stdio.h>#include <string.h>#include <stdlib.h>const unsigned MAXSTUDS = 150; \/\/ 学生人数const unsigned MAXITEMS = 4; \/\/ 课程数目struct student {unsigned id; \/\/ 学号char name[16];double scores[MAXITEMS + 2]; \/\/ 增加平均成绩和总成绩}stus[MAXSTUDS];int num_stus ...

图书室管理系统
图书室管理系统 用C++语言该系统储存以下信息:1.对于同一作者同一书名的书,存储书名、书目编号、作者名、库存册数(不包括已借出的)、已借出册数。2.对于每一本书还要储存一个登录号(这是区别每一... 用C++语言该系统储存以下信息:1.对于同一作者同一书名的书,存储书名、书目编号、作者名、库存册数(不包括已...

用C语言编写一个简单的图书管理小程序
源代码如下:include<iostream> include<iomanip> include<string> include<fstream> include<stdio.h> using namespace std;const int maxb=10000; \/\/最多的图书 class book\/\/图书类 { int tag; \/\/删除标记1:已删0:未删 int number; \/\/isbn书号 char name[20]; ...

C++图书管理系统代码 只要图书类~
cout << "剩余图书:" << books.size() << endl << "已借出:" << borrowed_books.size() << endl;cout << "总计:" << books.size() + borrowed_books.size() << endl;};private:vector<Book *> books, borrowed_books;};void Book::addBook(){ cout << "请输入图书名称:"...

商品库存管理系统的c语言源代码
include <stdlib.h> include <conio.h> struct BOOK { int id,usr[10],total,store,days[10];char name[31],author[21];}books[100];\/*上面是结构体的定义,用于存放书籍及借书的信息。*\/ void page_title(char *menu_item){ clrscr();printf(">>> 图 书 管 理 系 统 <<<\\n\\n-...

秦州区15848175625: 求一图书管理系统C语言程序 -
离沾艾达: #includestruct BOOK { int id,usr[10],total,store,days[10]; char name[31],author[21]; }books[100]; /*上面是结构体的定义,用于存放书籍及借书的信息.*/ void page_title(char *menu_item) { clrscr(); printf(">>> 图 书 管 理 系 统 } /*上面是打印页...

秦州区15848175625: 用C语言编一个简单的图书管理系统(包括借阅查询还书三部分)(学生作业用) -
离沾艾达: 展开全部#include#include struct sale/*商品名的定义*/ {int number; char name[20]; float price; long count; long time; long date;}; /*各个函数*/ void input(struct sale s[7]);/*输入函数*/ void output(struct sale s[7]);/*输出函数*/ void seek(struct sale s[...

秦州区15848175625: 如何使用C语言编写图书管理系统? -
离沾艾达: 图书管理系统是运行于Windows系统下的应用软件,主要用于对图书馆中的图书信息进行增、删、改、查等操作,并且还可对使用该系统的用户进行登录名和密码的管理等.系统给用户提供了一个简单的人机界面,使用户可以根据提示输入操作...

秦州区15848175625: 用C语言编写简单的图书馆系统 -
离沾艾达: 换了一个,你看看:#include <iostream> #include <iomanip> #include <string> #include <fstream>//输入/输出文件流类 using namespace std; const int Maxr=100;//最多的读者 const int Maxb=100;//最多的图书 const int Maxbor=5;//每位读者最...

秦州区15848175625: 一个简单的图书管理系统,C语言 -
离沾艾达: #include#include int function1(); int function2(); int function3(); int function4(); int function5(); int function6(); int function7(); int function8(); int main(void) { int choice; printf("======大学信息管理系统=====\n"); printf("---------------------------\n"); ...

秦州区15848175625: 用C语言编图书管理系统 -
离沾艾达: #include #include #include #define STACK_INIT_SIZE 10 #define OK 1 #define TRUE 1 #define FALSE 0 #define ER...

秦州区15848175625: 求个人图书管理系统c语言代码,实现功能见问题补充 -
离沾艾达: #include#include struct Book { char number[15]; char writer[10]; char name[50]; }; void eatline() { char ch; while((ch=getchar())!='\n') continue; } int addbook(Book*b,int *n) { puts("请输入书号:"); gets(b[*n].number); puts("请输入作者:")...

秦州区15848175625: 求用C语言编写的图书信息管理系统
离沾艾达: (2) #include <stdio.h> #include <conio.h> #include <string.h> #include <stdlib.h> void ReadBookRecord(BookRecord*, FILE*); void FillRecord(char* line, BookRecord*); FILE* open_file(const char* file_name); void GetNumber(const char* file_name...

秦州区15848175625: C语言,图书管理查询系统,这个怎么运行? -
离沾艾达: 下载个VC编译软件; 然后新建一个C源文件的文件 把代码放进去就可以运行了.注意保存的地址,在对应文件夹下面可以找到.XEX的运行程序.

秦州区15848175625: 图书信息管理系统设计 c语言 -
离沾艾达: 高级语言程序设计(2)课程设计 一程序设计说明书【设计题目】图书馆借阅管理【问题描述】图书馆,适合用C++面向对象的功能来描述.图书馆管理系统分为借书、还书、图书管理和读者服务等四个部分.设计一个读者类Reader,记录每个...

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 星空见康网