#include"stdio.h"
#include"string.h"
#include"stdlib.h"
struct user
{char name[20];
char password[20];
char book[30];
};
struct book
{char name[30];
char kind[10];
char editor[10];
char publish[20];
char edition[2];
char pdate[8];
char isdn[13];
char price[8];
char buser[20];
char bdate[8];
char fbuser[20];
char fbdate[8];
char condition[10];
};
long w;
enroll()
{
FILE *fp;
int i,j;
char code1[20],code2[20];
struct user users;
char name[20];
system("cls");
fp=fopen("users","rb+");
printf("input name:");
gets(name);
do{
i=0;
rewind(fp);
for(;fread(&users,sizeof(struct user),1,fp)!=0;)
{
if(strcmp(users.name,name)==0)
{
i=1;
printf("the name is occupied:");
gets(name);
}
continue;
}
}while(i==1);
printf("code:");
评论0
最新资源