mariuszprus
Newbie level 6
hI i am not good speeg english so sorry for error i have a problem i must have program with division of polynomials in C + +
i look some program in google but i not found program with is good for me
i must division polynomials OF DEGREE x^11 by x^4+x+1
and i dont know how can i do in algorithm of c++
in program i must write in coefficients 0 or 1 in polynomials x^11 for example
P[7] // polynomial
G[]={1,0,0,1,1}// polynomial
cin>>P[0] //0 or 1
cin>>P[1]
.
.
.
.
cin>>P[7]
for exampl P[]={1,1,0,0,1,0,1,1,0,0,0,0}// so we have polynomial x^11+x^10+x^7+x^5+x^4
g[]={1,0,0,1,1}// soo we have x^4+x+1
and we must divide P[]/G[]
in result i need 2 table one for result and rest of divide
W[7]//result of divide
R[4]//rest of divide
so
P[]/G[]=W[] , R[]
the polynomial W[] and R[] must be a table of 0 or 1 for example
W[]={0,0,1,1,0,1,1,0}
and the rest of divide
R[]={0,1,0,1,0}
P[]
PLEASE HELP!!!!!!! if some body can give me code in c++ please i am not goot in programer and in the math
i look some program in google but i not found program with is good for me
i must division polynomials OF DEGREE x^11 by x^4+x+1
and i dont know how can i do in algorithm of c++
in program i must write in coefficients 0 or 1 in polynomials x^11 for example
P[7] // polynomial
G[]={1,0,0,1,1}// polynomial
cin>>P[0] //0 or 1
cin>>P[1]
.
.
.
.
cin>>P[7]
for exampl P[]={1,1,0,0,1,0,1,1,0,0,0,0}// so we have polynomial x^11+x^10+x^7+x^5+x^4
g[]={1,0,0,1,1}// soo we have x^4+x+1
and we must divide P[]/G[]
in result i need 2 table one for result and rest of divide
W[7]//result of divide
R[4]//rest of divide
so
P[]/G[]=W[] , R[]
the polynomial W[] and R[] must be a table of 0 or 1 for example
W[]={0,0,1,1,0,1,1,0}
and the rest of divide
R[]={0,1,0,1,0}
P[]
PLEASE HELP!!!!!!! if some body can give me code in c++ please i am not goot in programer and in the math