尝试打印出多项式邮件,即 10x^0+1*x^1 和 9*x^0+1*x^1 但是多项式打印为
10x^0+1*x^1 +9*x^0+1*x^1,这是我的for循环方程
for(int i=0; i<=p->deg; i++) {
if (p->coeffs[i]==0)
break; //dont want to print out any 0 constants
cout << p->coeffs[i] <<" * " << x << "^"<<i << " ";
if (p->coeffs[i]>0 && p->coeefs[i+1]!=0)
cout<< "+";
}