?? node.cpp
字號(hào):
#include "Fraction.cpp"
class node //節(jié)點(diǎn)node:s=0時(shí)存放分?jǐn)?shù),s=1時(shí)存放運(yùn)算符
{
public:
bool s;
Fraction Fr;
char sign;
node():s(0),Fr(0,1){};
node(const int&);
node(const char&);
node &operator=(const int&);
node &operator=(const char&);
node &operator=(const node&);
};
node::node(const int &x):Fr(x),s(0){}
node::node(const char &x):sign(x),s(1){}
node &node::operator=(const int &x)
{
s=0;
Fr.fm=1;
Fr.fz=x;
return (*this);
}
node &node::operator=(const char &x)
{
s=1;
sign=x;
return *this;
}
node &node::operator=(const node &x)
{
if(x.s)sign=x.sign;
else Fr=x.Fr;
s=x.s;
return *this;
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -