//creePolynome.c
#include <stdio.h>
#include <stdlib.h>
#include "struc.h"


void creePolynome (ptr_liste *L1, long coef, long exp)
{
    ptr_liste newchainon, temp;

    if (*L1==NULL)
    {
        newchainon=(ptr_liste)malloc(sizeof(struct malist));
        newchainon->suivant=NULL;
        *L1=newchainon;
        newchainon->coef=coef;
        newchainon->exp=exp;
    }
    else
    {
        newchainon=(ptr_liste)malloc(sizeof(struct malist));
        newchainon->suivant=NULL;
        temp=*L1;
            while (temp->suivant!=NULL)
            {
                temp=temp->suivant;
            }
        temp->suivant=newchainon;
        newchainon->coef=coef;
        newchainon->exp=exp;
    }
}    
