#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<conio.h>
#define file "lnode.txt"
int total=0;
typedef struct ElemType
{
char name[11];
int account;
char password[7];
float money;
}ElemType;
typedef struct lnode
{
ElemType data;
struct lnode *next;
}LINK;
void InitList(LINK *&L)
{
L=(LINK *)malloc (sizeof(LINK));
L->next=NULL;
}
void InsertList(LINK *&L)
{
int x;
LINK *s;
s=(LINK*)malloc(sizeof(LINK));
printf("请输入你要开户的姓名(10字符以内):");
scanf("%s",s->data.name);
x=rand()%10; //随机数
total+=x; //total随机增大一个数值(10以内)x
s->data.account=000+total;
printf("\n你开户的账号为:%d\n",s->data.account);
printf("请输入你账号的密码(6位数以内):");
scanf("%s",s->data.password);
s->data.money=0.00;
s->next=NULL;
if(L->next==NULL)
L->next=s;
else
{
s->next=L->next;
L->next=s;
}
printf("开户成功。\n");
}
void DeleteList(LINK *&L)
{
LINK *p=L,*q;