二元多项式计算能够按照指数和升序排列建立并输出多项式;能够完成两个多项式的加法,减法,乘法,并将结果存储于一个新的多项式

问题描述:

二元多项式计算
能够按照指数和升序排列建立并输出多项式;能够完成两个多项式的加法,减法,乘法,并将结果存储于一个新的多项式中.
1个回答 分类:综合 2014-10-12

问题解答:

我来补答
#include #include #include #include using namespace std; class _Item:public pair < int,int > { public:_Item():pair < int,int > (int(),int()){} _Item(int a,int b):pair < int,int > (a,b){} _Item(const _Item &rhs):pair < int,int > (rhs.first,rhs.second){} inline bool operator < (const _Item &other)const { return second < other.second; } inline bool operator==(const _Item &other)const { return second==other.second; } inline bool operator > (const _Item &other)const { return second > other.second; } inline void operator+=(const _Item &other) { first+=other.first; } inline void operator-=(const _Item &other) { first-=other.first; } inline void operator*=(const _Item &other) { first*=other.first; second+=other.second; } void operator=(const _Item &other) { first=other.first; second=other.second; } friend istream &operator>>(istream &is,_Item &it) { is>>it.first>>it.second; return is; } friend ostream &operato
 
 
展开全文阅读
剩余:2000
上一页:dc2inr3qec3r2
下一页:这样怎么写
也许感兴趣的知识