?? polynomial.h
字號:
#ifndef _MY_POLY_
#define _MY_POLY_
#include "Term.h"
#include <iostream.h>
#include <fstream.h>
class CPolynomial
{
private:
CTerm *m_pHead;
public:
CPolynomial( );
CPolynomial( CTerm *Know);//重載一個(gè)已存在的鏈表
~CPolynomial( );
int Length( );
int Empty( );
CTerm *GetHead( ) { return m_pHead; }
CTerm *GetPoint( int val ); //返回i號節(jié)點(diǎn)的地址
int GetDegree( int val );
int Insert( CTerm *p, int Degree, double Ceof ); //在地址是p的節(jié)點(diǎn)前插入元素
int PushBack( int Degree, double Coef );
int Delete( CTerm *p ); //刪除地址是p的元素
int Print(); //打印表
int Read1( ); //從p1中讀多項(xiàng)式
int Read2( ); //從p2Z中讀多項(xiàng)式
//重載一些運(yùn)算符進(jìn)行相關(guān)的運(yùn)算;
friend CPolynomial operator+ ( const CPolynomial &p1, const CPolynomial &p2);
friend CPolynomial operator- ( const CPolynomial &p1, const CPolynomial &p2);
friend CPolynomial operator* ( const CPolynomial &p1, const CPolynomial &p2);
//friend CPolynomial operator/ ( const CPolynomial &p1, const CPolynomial &p2);
//friend CPolynomial operator% ( const CPolynomial &p1, const CPolynomial &p2);
CPolynomial& operator= (const CPolynomial &p);
};
#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -