嘿嘿`高手`这个程序运行了一下是对的`
一如往昔……
#include <stdio.h>
#include <malloc.h>
typedef char datatype;
typedef struct node
{
datatype data;
struct node *next;
}linklist;
linklist *p,*q,*head;
main()
{
char c;
head = (linklist *)malloc(sizeof(linklist));
head->next = NULL;
p = head;
c = getchar();
while(c != '@')
{
q = (linklist *)malloc(sizeof(linklist));
q->data = c;
q->next = NULL;
p->next = q;
p = p->next;
c = getchar();
}
for(p=head->next; p!=NULL; p=p->next)
{
printf("%5c", p->data);
}
}