Bitte um Hilfe bei Funktion
-
Hallo,
bräuchte - zum letzen Mal und ganz dringend - nochmal eure Hilfe:Ich habe eine Formel, die lautet (x-x0) + (x-x0)(x-x1) + (x-x0)(x-x1)*(x-x2)....wie kann ich das als Funktion programmieren? Also dass der Vorgänger-Term immer dabei ist und ein (x-xi) hinzugefügt wird? was ich mir ausgedacht hatte, klappt leider nicht.

for (k=n; k>0; k--){
printf ("%g * ",differenzen(0,n-k+1));
oleee = oleee + printf ("(x-x%g)",(n-k));
printf (" + ");}
dankeschööön!
-
for(int i=0; i<=n; i++) { if(i>0) cout<<"+"; for(int j=0; j<=i; j++) { if(j>0) cout<<"*"; cout<<"(x-x"<<j<<"); } } cout<<endl;