#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<string.h>
#include<io.h>
#define MAXNUM 2000
typedef struct{
char isbn[10];//书序号
char bkName[30];//书名
char author[20];//作者
float price;//单价
int num;//数量
} Book;
int bookNum=3;
Book bk[MAXNUM]={"001","C Primer Plus","Stephen Prata",89.00,10,
"002","python","John zelle",78.00,20,
"003","The Dream of Red Mansion","CaoXueQin",38.00,30};
void myGets(char *ps){
fflush(stdin);
gets(ps);
int seekBkNo(char *bkNo){//查找书籍
int i;
for(i=0;i<bookNum;i++){
if(strcmp(bk[i].isbn,bkNo)==0) break;
}
if(i>=bookNum) return -1;
if(bk[i].num<=0) return -2;
return i;
void input()//图书入库 用书号查找,如果没有则添加。用文件