1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#include <iostream>
using namespace std;
const int MAX = 40;
#include "HugeInteger.h"
int main()
{
int op1[MAX] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,2,2,0};
int op2[MAX] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,1,0};
char op;
op = '*';
HugeInteger object(op1);
HugeInteger arr(op2);
cout << "object: " << object << endl;
cout << "arr: " << arr << endl;
if (op == '+')
arr = arr + object;
else
arr = arr * object;
cout << "The answer is: " << arr << endl;
return 0;
}
|