#includestdio.h
#includestring.h
#includemalloc.h
typedef struct simple
{
struct
{
int coef;
int expn;
}simple2 ;
struct simple * next;
}*linklist;
linklist creat()
{
linklist p,q,head;
int n=0;
p=NULL;
q=(linklist)malloc(10*sizeof(int));
head=q;
printf(\"please input the coef\");
scanf(\"%d\",simple2.coef);
printf(\"please input the expn\");
scanf(\"%d\",simple2.expn);
while((p-simple2.coef!=123456)simple2.expn!=123456))
{
p=q;
q=(linklist)malloc(10*sizeof(int));
p-next=q;
printf(\"please input the ceof\");
scanf(\"%d\",simple2.coef);
printf(\"please input the expn\");
scanf(\"%d\",simple2.expn);
}
return head;
}
void main()
{
creat();
}这是代码,
|