master
1342552657@qq.com 6 years ago
parent e24355908d
commit 8cb12edaa1

@ -0,0 +1 @@
aa aa 1-2-2524 25 52 52 cc

@ -6,6 +6,7 @@
#include<time.h> #include<time.h>
#include<dos.h> #include<dos.h>
#include<conio.h> #include<conio.h>
#include<ctype.h>
#define N 100 #define N 100
void menu(); void menu();
@ -49,7 +50,7 @@ void tushuluru()
void ss(); void ss();
j=0; j=0;
printf("请输入你要插入的图书信息\n"); printf("请输入你要插入的图书信息\n");
printf("在录入图书年月日信息时:请这样输入日 月 年\n"); printf("在录入图书年月日信息时:请这样输入日 月 年\n");
printf("名称\t作者\t日-月-年\t价格\t数量\t库存\t出版社\n"); printf("名称\t作者\t日-月-年\t价格\t数量\t库存\t出版社\n");
FILE*fp; FILE*fp;
out: out:
@ -86,13 +87,13 @@ void huanyingxitong()
void ss()//图书管理系统界面 void ss()//图书管理系统界面
{ {
int x,y; int x,y;
system("cls"); system("cls");
printf("\t\t\t\t\t\t\t\t\t\t\n"); printf("\t\t\t\t\t\t\t\t\t\t\n");
printf("\n \t\t\t\t请按键 1-5选择实现功能\n\n"); printf("\n \t\t\t\t请按键 1-5选择实现功能\n\n");
printf(" \t\t\t1.图书信息录入\n\n"); printf(" \t\t\t1.图书信息录入\n\n");
printf(" \t\t\t2.图书信息浏览\n\n"); printf(" \t\t\t2.图书信息浏览\n\n");
printf(" \t\t\t3.按书名查询图书查询\n\n"); printf(" \t\t\t3.按书名查询图书查询\n\n");
printf(" \t\t\t4.图书单价的修改与图书信息删除\n\n"); printf(" \t\t\t4.图书单价的修改与图书信息删除\n\n");
printf(" \t\t\t5.退出系统AND欢迎词\n\n"); printf(" \t\t\t5.退出系统AND欢迎词\n\n");
printf("请输入你要选择的菜单\n"); printf("请输入你要选择的菜单\n");
printf("\n"); printf("\n");
@ -165,7 +166,7 @@ void xinxixiugai()
{ {
printf("你输入错误,请重新输入\n"); printf("你输入错误,请重新输入\n");
goto ww; goto ww;
} }
} }
void tushuxinxixiugai() void tushuxinxixiugai()
{ {
@ -178,15 +179,15 @@ xx:
j=0; j=0;
fp=fopen("a.txt","r+"); fp=fopen("a.txt","r+");
while(!feof(fp)) while(!feof(fp))
{ {
fscanf(fp,"%s%s%d%d%d%d%d%d%s",tushuxinxu[j].name,tushuxinxu[j].author,&tushuxinxu[j].year,&tushuxinxu[j].yue,&tushuxinxu[j].ri,&tushuxinxu[j].price,&tushuxinxu[j].amount,&tushuxinxu[j].kuchun,tushuxinxu[j].publisher); fscanf(fp,"%s%s%d%d%d%d%d%d%s",tushuxinxu[j].name,tushuxinxu[j].author,&tushuxinxu[j].year,&tushuxinxu[j].yue,&tushuxinxu[j].ri,&tushuxinxu[j].price,&tushuxinxu[j].amount,&tushuxinxu[j].kuchun,tushuxinxu[j].publisher);
j++; j++;
} }
rewind(fp); rewind(fp);
fclose(fp); fclose(fp);
CC=fopen("a.txt","w+"); CC=fopen("a.txt","w+");
printf("请问你想改正的单价是:"); printf("请问你想改正的单价是:");
scanf("%d",&q); scanf("%d",&q);
for(h=0;h<j;h++) for(h=0;h<j;h++)
{ {
if(tushuxinxu[h].price==q) if(tushuxinxu[h].price==q)
@ -209,7 +210,7 @@ while(tushuxinxu[z].price!=0)
z++; z++;
} }
rewind(CC); rewind(CC);
fclose(CC); fclose(CC);
printf("你是否想继续修改\n"); printf("你是否想继续修改\n");
printf("如果是请输入1;返回菜单请输入:2\n"); printf("如果是请输入1;返回菜单请输入:2\n");
scanf("%d",&i); scanf("%d",&i);
@ -222,7 +223,7 @@ if(i==2)
system("cls"); system("cls");
ss(); ss();
} }
} }
void tushuxinxishanchu() void tushuxinxishanchu()
{ {
int j,h,d,e,z,s,q; int j,h,d,e,z,s,q;
@ -314,38 +315,38 @@ out :
goto out; goto out;
} }
} }
void menu() void menu()
{ {
int p; int p;
char ch,pwd[256]; char ch,pwd[256];
char c[] = {"111222"}; char c[] = {"111222"};
while(1) while(1)
{ {
system("cls"); system("cls");
p=0; p=0;
system("color 2"); system("color 0");
printf("*******系统登录界面*************\n"); printf("*******系统登录界面*************\n");
printf(" 请输入密码:\n"); printf(" 请输入密码:\n");
goto_xy(18,1); goto_xy(18,1);
while((ch=getch())!='\r') while((ch=getch())!='\r')
{ {
if(ch==8) if(ch==8)
{ {
putchar('\b'); putchar('\b');
putchar(' '); putchar(' ');
putchar('\b'); putchar('\b');
if(p>0) if(p>0)
p--; p--;
} }
if(!isdigit(ch)&&!isalpha(ch)) if(!isdigit(ch)&&!isalpha(ch))
continue; continue;
putchar('*'); putchar('*');
pwd[p++]=ch; pwd[p++]=ch;
} }
pwd[p]=0; pwd[p]=0;
if(strcmp(c,pwd)==0) if(strcmp(c,pwd)==0)
{ {
system("color 2"); system("color 0");
printf("\n输入密码正确\n"); printf("\n输入密码正确\n");
p=0; p=0;
system("cls"); system("cls");
@ -353,11 +354,11 @@ void menu()
} }
else else
{ {
system("color 2"); system("color 0");
system("cls"); system("cls");
printf("******密码错误!*******\n"); printf("******密码错误!*******\n");
system("pause"); system("pause");
} }
} }
} }
@ -400,7 +401,7 @@ void shumingchaxun()
int h,j,z,count; int h,j,z,count;
j=0; j=0;
h=0; h=0;
char an[100]; char an[100];
FILE*fp; FILE*fp;
fp=fopen("a.txt","r"); fp=fopen("a.txt","r");
@ -511,51 +512,55 @@ xx:
} }
} }
void welcome() void welcome()
{ {
Sleep(200); Sleep(200);
system("color A"); system("color A");
printf("\n\n\n\n\n \t\t"); printf("\n\n\n\n\n \t\t");
Sleep(200); Sleep(200);
system("color B"); system("color B");
printf("\t") ; printf("\t") ;
Sleep(200); Sleep(200);
system("color C"); system("color C");
printf("\t") ; printf("\t") ;
Sleep(200); Sleep(200);
system("color D"); system("color D");
printf("\t") ; printf("\t") ;
Sleep(200); Sleep(200);
system("color E"); system("color E");
printf("\t") ; printf("\t") ;
Sleep(200); Sleep(200);
system("color A"); system("color A");
printf("\t") ; printf("\t") ;
Sleep(200); Sleep(200);
system("color B"); system("color B");
printf("\t"); printf("\t");
Sleep(200); Sleep(200);
system("color A"); system("color A");
printf("\t"); printf("\t");
Sleep(200); Sleep(200);
system("color 08"); system("color 08");
printf("\t") ; printf("\t") ;
Sleep(200); Sleep(200);
system("color 09"); system("color 09");
printf("\t") ; printf("\t") ;
Sleep(200); Sleep(200);
system("color B"); system("color B");
printf("\t") ; printf("\t") ;
Sleep(200); Sleep(200);
system("color F"); system("color F");
printf("\t\n") ; printf("\t\n") ;
} }
int main() int main()
{ {
welcome(); welcome();
system("cls"); system("cls");
menu(); menu();
return 0; return 0;
} }

Binary file not shown.
Loading…
Cancel
Save