#include

#include


#define LEN 10 //链表长度


struct Node

{

   struct Node *next; 

   char data;

};


//创建单向链表

void create(struct Node *head)

{

    int i;

int code=65;

struct Node *node=head; 

    

     

for(i=0;i

{

  struct Node *temp=(struct Node *)malloc(sizeof(struct Node));

       temp->data = (char)code;

  temp->next =NULL;

  node->next=temp;

  node=temp;

}

}


//遍历单向链表

void iterator(struct Node *head)

{

   

   struct Node *node=NULL;

   if(head->next!=NULL)

   {

       node=head->next;

   }

 

   do

   {

       printf("%c\n",node->data);

  node=node->next;

   }while(node!=NULL);

}


int main()

{

   struct Node *head = (struct Node *)malloc(sizeof(struct Node));

   head->next=NULL;

   create(head);

   iterator(head);

   return 0;

}