/*
*Fun Name: InitLink
*Fun Could: Create a Link
*Input Num: none
*Output Num: L
*/
Link InitLink() {
Link L;
L =(Link)malloc(sizeof(Nnode));
L->next =NULL; return L; }
/*
*Fun Name: InsertL
*Fun Could: Insert a Link
*Input Num: L,e
*Output Num: L
*/
Link InsertL(Link L,char e) {
Link s,r;
r = L; while(r->next !=NULL)
r = r->next;
s =(Link)malloc(sizeof(Nnode));
s->data = e;
r->next = s;
s->next =NULL; return L; }
/*
*Fun Name: DeleteL
*Fun Could: Delete a jiedian
*Input Num: L,i
*Output Num: L
*/
Link DeleteL(Link L,int i) {
Link r,p; int i1,i2;
r = p = L;
i1 = i2 = i; while(i1 != 1){
p = p->next;
i1--; } while(i2 != 0){
r = r->next;
i2--; }
p->next = r->next; free(r); return L; }
/*
*Test
*/ int main() {
Link L,r; char i;
L = InitLink(); for(i = 48; i < 58; i++)
L = InsertL(L,i);
L = DeleteL(L,9);
r = L->next; while(r !=NULL){ printf("%c\n", r -> data);
r = r->next; } return 0; }