这怎么会出问题呢?
#include<stdio.h>#include<stdlib.h>struct node{ int data; struct node *next;};struct node* creat(){ struct node *p,*q,*h; int i,n; printf("input the node you want creat:"); scanf("%d",&n); h=(struct node*)malloc(sizeof(struct node)); h->data=n; h->next=NULL; q=h; for(i=0;i<n;i++) { p=(struct node*)malloc(sizeof(struct node)); printf("input num[%d]:",i); q->next=p; scanf("%d",p->data); p->next=NULL; q=p; } return h;}void print(struct node *h){ struct node *p; p=h->next; while(p!=NULL) { printf("%c",p->data); p=p->next; }}main(){ struct node *head; head=creat(); print(head);}