giúp em sửa lỗi cái phần đạo hàm với ạ??
#include<iostream>
#include<iomanip>
#include<cmath>
using std::cout;
using std::cin;
using std::endl;
using std::setw;
typedef float dathuc[100];
dathuc P,Q;
int m,n;
void nhap(dathuc &K, int &k){
cout << "nhap bac da thuc = "; cin >> k;
for(int i = 0; i <= k; i++){
cout << "K[" << i << "] = ";
cin >> K[i];
}
}
void xuatmu(int i){
if(i == 1) cout << "X ";
if(i > 1) cout << "X^" << i;
}
void print(dathuc K, int k){
int i = 0;
while(K[i] <= 0 && i <= k) i++;
cout << K[i];
xuatmu(i);
while(i++ < k){
if(K[i] > 0){
cout << " + " << K[i];
xuatmu(i);
}
if(K[i] < 0){
cout << " - " << -K[i];
xuatmu(i);
}
}
}
void tinh(dathuc K, int k, float &x){
cout << "\nnhap gia tri x ="; cin >> x;
int p = K[k];
for(int i = k-1; i >= 0; i--){
p = p*x + K[i];
}
cout<<"\n gia tri cua da thuc P theo cong thuc Horner ";
cout << " P = " << p;
}
void daoham(dathuc K, int k){
dathuc P;
for(int i = 0; i <= k-1; i++)
P[i] = i*K[i];
cout << endl<< "P' = "; print(P,k-1);
}
int main(){
dathuc K;
float x;
nhap(P,m);
print(P,m);
tinh(P,m,x);
daoham(K,m);
return 0;
}