|
|
|
|
#include<stdio.h>
|
|
|
|
|
#include<string.h>
|
|
|
|
|
#include<windows.h>
|
|
|
|
|
#include<math.h>
|
|
|
|
|
#include<stdlib.h>
|
|
|
|
|
#include<time.h>
|
|
|
|
|
#include<dos.h>
|
|
|
|
|
#include<conio.h>
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
system("color f4");
|
|
|
|
|
struct BOOK
|
|
|
|
|
{
|
|
|
|
|
char title[20];
|
|
|
|
|
char author[20];
|
|
|
|
|
char publice[20];
|
|
|
|
|
char time[20];
|
|
|
|
|
float price;
|
|
|
|
|
char locate[20];
|
|
|
|
|
int base;
|
|
|
|
|
//<2F>鼮<EFBFBD><E9BCAE><EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD>ߣ<EFBFBD><DFA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>磬<EFBFBD><E7A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3>۸<EFBFBD><DBB8><EFBFBD><EFBFBD><EFBFBD>Ŀ¼<C4BF>е<EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct BOOK *book;
|
|
|
|
|
int N=5;
|
|
|
|
|
book=(struct BOOK*)malloc(N*sizeof(struct BOOK));
|
|
|
|
|
strcpy( book[0].title, "<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>֮<EFBFBD>ۡ<EFBFBD>");
|
|
|
|
|
strcpy( book[0].author, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
strcpy( book[0].publice, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
strcpy( book[0].time, "2016<EFBFBD><EFBFBD>5<EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>");
|
|
|
|
|
book[0].price=99.00;
|
|
|
|
|
strcpy( book[0].locate, "<EFBFBD><EFBFBD>¥302");
|
|
|
|
|
book[0].base=50;
|
|
|
|
|
|
|
|
|
|
strcpy( book[1].title, "<EFBFBD><EFBFBD><EFBFBD>˼<EFBFBD>ʧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
strcpy( book[1].author, "̫<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
strcpy( book[1].publice, "<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
strcpy( book[1].time, "2016<EFBFBD><EFBFBD>10<EFBFBD><EFBFBD>");
|
|
|
|
|
book[1].price=26.00;
|
|
|
|
|
strcpy( book[1].locate, "<EFBFBD><EFBFBD>¥302");
|
|
|
|
|
|
|
|
|
|
strcpy( book[2].title, "<EFBFBD><EFBFBD>Χ<EFBFBD>ǡ<EFBFBD>");
|
|
|
|
|
strcpy( book[2].author, "Ǯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
strcpy( book[2].publice, "<EFBFBD>Ϻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
strcpy( book[2].time, "1947<EFBFBD><EFBFBD>");
|
|
|
|
|
book[2].price=40.00;
|
|
|
|
|
strcpy( book[2].locate, "<EFBFBD><EFBFBD>¥302");
|
|
|
|
|
|
|
|
|
|
strcpy( book[3].title, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塷");
|
|
|
|
|
strcpy( book[3].author, "Ī<EFBFBD><EFBFBD>");
|
|
|
|
|
strcpy( book[3].publice, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
strcpy( book[3].time, "2007<EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>");
|
|
|
|
|
book[3].price=28.00;
|
|
|
|
|
strcpy( book[3].locate, "<EFBFBD><EFBFBD>¥302");
|
|
|
|
|
|
|
|
|
|
strcpy( book[4].title, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
strcpy( book[4].author, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˹");
|
|
|
|
|
strcpy( book[4].publice, "<EFBFBD>¾<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD>");
|
|
|
|
|
strcpy( book[4].time, "2011<EFBFBD><EFBFBD>6<EFBFBD><EFBFBD>");
|
|
|
|
|
book[4].price=39.50;
|
|
|
|
|
strcpy( book[4].locate, "<EFBFBD><EFBFBD>¥302");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct user
|
|
|
|
|
{
|
|
|
|
|
char user_name[100];
|
|
|
|
|
char user_pass[100];
|
|
|
|
|
}stu[2]={{"xiaocong001","123456"},{"zhuzhu002","123456"}};
|
|
|
|
|
int num1=0;
|
|
|
|
|
int num2=0;
|
|
|
|
|
printf("***************<2A><>ӭ<EFBFBD><D3AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҹ<EFBFBD><D2B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>嵥<EFBFBD><E5B5A5><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>***************\n"); //<2F><>¼ϵͳ
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
char u[100];
|
|
|
|
|
|
|
|
|
|
scanf("%s",u);
|
|
|
|
|
|
|
|
|
|
if(strcmp(stu[0].user_name,u)==0||strcmp(stu[1].user_name,u)==0)
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룡\n");
|
|
|
|
|
num1++;
|
|
|
|
|
if(num1==3)
|
|
|
|
|
{
|
|
|
|
|
printf("\n\t\t<EFBFBD>ܱ<EFBFBD>Ǹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<EFBFBD><EFBFBD>\n");
|
|
|
|
|
exit(0); }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("***************<2A><>ӭ<EFBFBD><D3AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҹ<EFBFBD><D2B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>嵥<EFBFBD><E5B5A5><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>***************\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺");
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
char p[100];
|
|
|
|
|
scanf("%s",p);
|
|
|
|
|
if(strcmp(stu[0].user_pass,p)==0)
|
|
|
|
|
{
|
|
|
|
|
printf(" <20><>¼<EFBFBD>ɹ<EFBFBD>\n");
|
|
|
|
|
break;
|
|
|
|
|
}else
|
|
|
|
|
{
|
|
|
|
|
printf(" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
num2++;
|
|
|
|
|
if(num2==3)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Σ<EFBFBD>ϵͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD>");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
system("cls"); //ˢ<><CBA2>
|
|
|
|
|
system("color e5");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char t[20],a[20];
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҪѰ<EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n") ;
|
|
|
|
|
scanf("%s%s",&t,&a);
|
|
|
|
|
for(i=0;i<5;i++)
|
|
|
|
|
{
|
|
|
|
|
if((strcmp(t,book[i].title)==0))
|
|
|
|
|
{
|
|
|
|
|
if((strcmp(a,book[i].author)==0))
|
|
|
|
|
{
|
|
|
|
|
printf("The book is in the list.");
|
|
|
|
|
printf( "<EFBFBD><EFBFBD><EFBFBD><EFBFBD> : %s\n", book[i].title);
|
|
|
|
|
printf( "<EFBFBD><EFBFBD><EFBFBD><EFBFBD> : %s\n", book[i].author);
|
|
|
|
|
printf( "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> : %s\n", book[i].publice);
|
|
|
|
|
printf( "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD> : %s\n", book[i].time);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
int n;
|
|
|
|
|
scanf("%d",&n);
|
|
|
|
|
if(n>(book[i].base))
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD><EFBFBD>淶Χ<EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
book[i].base=book[i].base - n;
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>%d <20><> %s\n",n,book[i].title);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|