求大数运算C++源代码,有重+ -*/ << >>比较

来源:百度知道 编辑:UC知道 时间:2024/05/24 22:48:45
这是一道项目实验题,急求!!!!!!!求那位大侠帮帮忙明天交了
用类和指针实现

#ifndef NODE
#define NODE
class Node
{
public:
char cBit;
Node* pNext;
Node(char c):cBit(c)
{
pNext=0;
}
Node operator=(const Node& node)
{
this->pNext=node.pNext;
this->cBit=node.cBit;
return *this;
}
};
#endif
/**************************/
#ifndef STACK
#define STACK
#include "node.h"
#include "iostream.h"
#include "process.h"
class stack
{
public:
stack()
{
pTop=NULL;
nSize=0;
}
explicit stack(char);
stack(stack&);
stack operator=(stack&);

bool push(char);
char pop();
char Iter(int &);
bool empty(){
return nSize<=0;
}
int GetSize() const
{
return nSize;
}
private:
Node* pTop;
int nSize;
};
stack::stack(char init):nSize(