Sunteți pe pagina 1din 2

# #include <iostream>

#include <string.h>
#include <conio.h>
float coef;
void adaug (nod*& v, nod*& sf, int gr, float cf)
{
nod* c;
c=new nod;
c->coef=cf;
if(v==0)
v=sf=c;
else
{
sf=c;
}}
nod* crePolinom(int nr_termeni)
{
nod*vf=0, *sf;
float coeficient;
cout<<"\n Introduceti "<<nr_termeni<<" termeni pentru primul polinom: \n";
for (int i=0;i<nr_termeni;i++)
{
cout<<" coeficientul lui X = ";
cin>>coeficient;
}
return vf;}
void sterg (nod*v)
{
nod*c=v;
while(v)
{
delete c;
c=v;
}}
void afis (nod*v)
{
int i=0;
while(v)
{
if (i) cout<<"+";
i++;
}
cout<<endl;}
{
nod*c1=v1;
nod*c2=v2;
nod*v=0, *sf;
while (c1&&c2)
{
if(c1->coef+c2->coef)
}
else
}
else

}

if(c1)
while(c1)
else
while(c2)
{
}
return v;}
nod* mulMonom(nod*v, int gr, float cf)
{
nod*vf=0, *sf;
while(v)
{
}
return vf;}
nod* mul(nod*v1,nod*v2)
{
nod*v=0;
while (v2)
{
nod*vman=0, *vman1;
vman1=v;
sterg(vman1);
sterg(vman);
}
return v;}
void main()
{int m, n;
cout<<"\n Scrieti cati termeni are primul polinom: ";cin>>m;
nod*p1=crePolinom(m);
cout<<"\n Scrieti cati termeni are al doilea polinom: ";cin>>n;
nod*p2=crePolinom(n);
cout<<"\n Primul Polinom: \n";
afis(p1);
cout<<"\n Al doilea Polinom: \n";
afis(p2);
cout<<"\n Suma polinoamelor este: \n";
afis(s);
nod*p=mul(p1,p2);
cout<<"\n Produsul polinoamelor este: \n";
afis(p);
getch();
}

## Meniu subsol

### Obține aplicațiile noastre gratuite

Drepturi de autor © 2022 Scribd Inc.
Drepturi de autor © 2022 Scribd Inc.

## Meniu subsol

### Obține aplicațiile noastre gratuite

Drepturi de autor © 2022 Scribd Inc.
Drepturi de autor © 2022 Scribd Inc.