#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdbool.h>
struct link
{
char name[20];
char password[20];
struct link *next;
} link,*linklist;
struct link* add(struct link *L,char *name,char *password);
void print(struct link *L);
struct link* delete(struct link *L,char *name);
//bool judge(char *name,char *password);
void update(char *name,char *password);
int main()
{
struct link *L;
size_t a;
L=(struct link*)malloc(sizeof(struct link));
L->next=NULL;
L=add(L,"hello","1");
L=add(L,"world","2");
L=add(L,"me","3");
print(L);
printf("----------------\n");
L=delete(L,"me");
print(L);
}
struct link* delete(struct link *L,char *name)
{
struct link *p,*q,*t;
p=L;
// t=p;
while(p)
{
if(strcmp(p->name,name)==0)
{
t->next=p->next;
free(t);
}
t=p;
p=p->next;
}
return L;
}