#include<stdio.h>
#include<malloc.h>
#include<conio.h>
#define ERROR 0
#define OK 1
#define EQUAL 1
#define OVERFLOW -1
#define LIST_INIT_SIZE 100
#define LISTINCREMENT 10
typedef struct STU {
float coef;
int expn;
struct STU *next;
}LNode,*linklist;
int init(linklist *L){
*L=(LNode *)malloc(sizeof(LNode));
if(!L) exit(ERROR);
(*L)->next=NULL;
return OK;
}/*init */
linklist creatpolyn(){
LNode *p,*q,*s,*head=NULL;
double coef;
int expn;
head=(linklist)malloc( sizeof(LNode) );
if(head==NULL)
{
printf("Allocable memory fail!\n");
return NULL;
}
head->coef =0.0;
head->expn =0;
head->next =NULL;
printf("Please input xishu and zishu (intput 0 0 end):\n");
/*scanf("%lf%d",&coef,&expn);*/
printf("Please input xishu:");
scanf("%lf",&coef);
printf("please input zishu:");
scanf("%d",&expn);
while( coef !=0 ||expn !=0 )
{
if(coef==0){
printf("Please input xishu:");
scanf("%lf",&coef);
printf("please input zishu:");
scanf("%d",&expn);
}
else{
s = (linklist)malloc(sizeof(LNode));
s->coef = coef;
s->expn = expn;