帮忙看下是哪的问题!
#include<stdio.h>#include<malloc.h>
#include<stdlib.h>
typedef struct NODE
{
int value;
struct NODE *link;
}Node;
int increse(Node **linkp,int new_value)
{
register Node *current;
register Node *new1;
while((current=*linkp)!=NULL&¤t->value<new_value)
linkp=¤t->link;
new1=(Node *)malloc(sizeof(Node));
if(new1==NULL)
{
printf("Get memory error!");
return 0;
}
new1->value=new_value;
new1->link=current;
*linkp=new1;
return 1;
}
void main()
{
int n,i,temp;
Node **linkp;
Node *p;
printf("Please input the number of the link:\n");
scanf("%d",&n);
p=(Node *)malloc(sizeof(Node));
linkp=&p;
for(i=0;i<n;i++)
{
printf("Please input the %d number\n",i+1);
scanf("%d",&temp);
increse(linkp,temp);
}
for(i=0;i<n;i++)
{
printf("%5d",p->value);
p=p->link;
}
}