1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| poly produit(poly c,poly d)// fonction de produit 2 polynôme
{
poly h=NULL,cc,dd;
cc=c;
while(cc!=NULL)
{dd=d;
while(dd!=NULL)
{
h=creationfin(h,(cc->coeff)*(dd->coeff),cc->degre+dd->degre);
dd=dd->suiv;
}
cc=cc->suiv;
}
return h;
}
poly som(poly v)// fonction qui réalise la somme des degrés égaux
{
poly h=NULL,b,n,k;
b=v;
while(b!=NULL)
{ n=b->suiv;
while(n!=NULL)
{
if(b->degre==n->degre)
b->coeff+=n->coeff;
n=n->suiv;
}
b=b->suiv;
}
return v;
} |