#include
Typedef int datatype.
Typedef struct node
{
Datatype data;
Struct node * next;
} linkst;
Void insent (linkst * s1, linkst * p)
{
P - & gt; Next=s1 - & gt; next;
S1 - & gt; Next=p;
}
Void crealist linkst * (sl)
{
Linkst * p;
P=(linkst *) malloc (sizeof (linkst));
The scanf (" % d ", & amp; (p - & gt; Data));
Insent (sl, p);
printf("\n");
}
Void the display (linkst * sl)
{
Linkst * p;
P=sl - & gt; next;
While (p)
{
Printf (" % d ", p - & gt; The data);
P=p - & gt; next;
}
}
Int main ()
{
Linkst * l=(linkst *) malloc (sizeof (linkst));
L - & gt; Next=NULL;
Printf (" please enter the number 1 \ n ");
Crealist (l);
The display (l);
return 0;
}
CodePudding user response:
The scanf (" % d ", & amp; (p - & gt; Data)); Inside this many Spaces behind "% d", should be like this:the scanf (" % d ", & amp; (p - & gt; Data));
CodePudding user response:
the scanf (" % d ", & amp; P - & gt; The data);
Space problem ~