! "#!$%"&$ '()**+,)*-). "/01!23 45 6/0784984:6" ;<=>?/@0,0-' AB CBD CEF ,!"#$%&'()*+,-+./012"345 5& )*+,6!)*+1,02)*+,78)*+1,9:)*+,6 )*+1, !)*",;&<7= ,!#$%&'()*+,-+./012345 5& )*+,6!)*+1,02)*+,78)*+1,9:)*+,6 )*+1, !)*,;&<7= ,9>&?!#$%&'()*+,-+./012 345 5&)*+,6!)*+1,02)*+,78)*+1,9 :)*+,6)*+1, !)*,;&< 7= ,01!@2A "4BC "BC "4BC "4BC D'EF 6!EGH IJKL4M4"4"4LL4MC4BC4NN4NO #PC "4QC "4BC #BPC I; ! I*", I*, I*B, I*M, I*R, I*C, I*S, I*Q, I*N, L M " " LL MC BC NN N ! * L M " LL )G MC -H NN !B ' L " -H LL )G MC NN !M L " N )G LL MC NN !R " N BC 'G LL NN !C N BC MC HH LL !S BC MC NN LL !Q MC NN LL !N NN LL &IJ KBL * ' + -* -H )G 'G HH ++ B 0TRU=V'F. ,WX#02Y⊇$$ZY ,#02$ZY6YZ[$Z[ ,\]#02$ZY[$ZY6$Z[ ,#02$ZY6$Z[$ZY[ "4BC "4BC "4BC "4BC D'EF#.:5E^_`a 3 _b-c3 B3 b`-cR3 M3 _`-UBdM3 R3 __-'WX3 C3 _-'\]3 S3 _b-@2'dC3 Q3 b-cM3 N3 _-SdQ3 L3 _`-@2'MdN3 "3`a-cC3 3_a-Ld"3 B3_`a-@2'Md3 4" 4" ' #include <conio.h> #include <iostream.h> #include <math.h> class DT { private: double a[20];// Mang chua cac he so da thuc a0, a1, int n ;// Bac da thuc public: void nhap(); void hienthi(); DT operator+(const DT &d2); double operator^(double x);// Tinh gia tri da thuc }; "4BC void DT::hienthi() { cout<<a[0]<<"X^0"; for (int i=1 ;i<= n ;++i) cout<<"+"<< a[i] <<"X^"<<i ; } "4BC #MPC void DT::nhap() { cout << "Bac da thuc:"; cin >> n; cout << "Nhap cac he so da thuc:" ; for (int i=0 ;i<=n ;++i) { cout << "\n He so bac"<<i<<":" ; cin >> a[i] ; } } "4BC DT DT::operator+(const DT &d2) { DT d; int k,i; k = (n > d2.n)?n:d2.n ; for (i=0;i<=k ;++i) if (i<=n && i<=d2.n) d.a[i] = a[i] + d2.a[i]; else if (i<=n) d.a[i] =a[i]; else d.a[i] = d2.a[i]; i = k; while (i>0 && d.a[i]==0.0) i; d.n=i; return d ; } "4QC double DT::operator^(double x) { double s=0.0 , t=1.0; for (int i=0 ;i<= n ;++i) { s+= a[i]*t; t *= x; } return s; } "4BC #RPC void main() { DT p,q,f; double x,g; clrscr(); cout <<"\n Nhap da thuc P :" ;p.nhap(); cout <<"\n Nhap da thuc Q :" ;q.nhap(); cout << "\n Nhap so thuc x :" ;cin >> x; f = (p+q); g = f^x; cout << "\n Da thuc f "; f.hienthi(); cout<<"\n x =" << x; cout << "\n f(x) = "<<g; getch(); } "4BC M!NJO PPPMMQDRSPPPPJTDPPPMMUFPPPPMM #CPC . 0TRU=V'F. ,WX#02Y⊇$$ZY ,#02$ZY6YZ[$Z[ ,]#02$ZY[$ZY6$Z[ ,#02$ZY6$Z[$ZY[ "4BC "4BC "4BC "4BC D'EF#.:5E^_`a 3 _b-c 3 B3 b`-cR3 M3 _` - UBdM3 R3 __ -& apos;WX3 C3 _ -& apos; ]3 S3 _b -@ 2'dC3 Q3 b-cM3 N3. b-cM3 N3 _ - SdQ3 L3 _` -@ 2'MdN3 " ;3` a-cC3 3_ a - Ld" ;3 B3_`a -@ 2'Md 3 4" 4" ' #include