急求C++高手!

来源:百度知道 编辑:UC知道 时间:2024/05/14 03:13:57
我有一个难题不知道怎么做,请各位高人帮我做一下,跪谢!
编写一个HugeInt类,用整型数组存放一个不超过30位的整数,要求成员函数实现以下功能:
(1)两个HugeInt类相加,结果仍为HugeInt类。
(2)两个HugeInt类相减,结果仍为HugeInt类。
(3)两个HugeInt类相乘,结果仍为HugeInt类,判断是否溢出。
(4)两个HugeInt类相除,结果仍为HugeInt类。
(5)比较两个HugeInt类的大小。
(6)判断两个HugeInt类是正数还是负数。
此题是我们我上机实验作业,马上就要上交了,请各位高人帮我做一下啊 (希望写的编译可以通过)
继续等待C++精英的出现啊
上面两位仁兄,一个没看懂题意,一个书写太恐怖了,空格都省了,而且我改了一下午,编译还是不能通过,问题太多了
我马上就要上交了,请高手帮帮我啊

上面我发错了

#include "stdafx.h"
#include "math.h"
using namespace std;

class HugeInt
{
public:
HugeInt();
void SetData(char *StrNum);
HugeInt jian(HugeInt&,HugeInt&);
HugeInt operator+(HugeInt&);
HugeInt operator-(HugeInt&);
HugeInt operator*(HugeInt&);
HugeInt operator/(HugeInt&);
bool operator>(HugeInt&);
friend ostream& operator<<(ostream&,HugeInt&);
public:
char *str;
int num[5];
bool iszheng;

};

HugeInt::HugeInt()
{
for(int i=0;i<5;i++) num[i]=0;
str="";
iszheng=true;
}
void HugeInt::SetData(char *StrNum)
{
str = StrNum;
if(str[0]=='-')
{
iszheng=false;
str=str+1;
}
int size = (