This is a problem extended from Problem 13487 (nthu.edu.tw).
Instead of doing addition, you are asked to implement the operator * to perform multiplication.
The following is the class INT:
#include <iostream>
class INT {
public:
INT();
void mulby10();
INT operator=(INT);
INT operator+(INT);
INT operator*(INT);
friend std::istream &operator>>(std::istream &, INT &);
friend std::ostream &operator<<(std::ostream &, INT);
private:
char *data;
int len;
};
Except INT operator*(INT), other functions has been implemented and provided in main.cpp. You should check how the operators +, >>, << are implemented and how the data is stored.
Note that additional tool mulby10() is provided to multiply INT by 10. For instance:
You have two ways to implement the multiplication:
There are two lines. Each line has a single integer.
No leading 0's are given in the test cases. E.g. 0001239487.
The total length of the two integers is at most 10000 characters.
Compute and output the product of the two integers.