// Programmieren 1, Praktikum 6, Aufgabe 3 // Author: Sven Eisenhauer // Date: 17.01.2005 // File: main.cpp // Description: Application to test class Integer40 #include "Int40.h" #include #include using std::cin; using std::cout; using std::endl; ostream& operator<<(ostream &out, Integer40 &right); istream& operator>> (istream &in, Integer40 &right); Integer40& operator+ (const Integer40&, const Integer40&); Integer40& operator- (const Integer40&, const Integer40&); int main() { Integer40 bigint1; Integer40 bigint2; //bigint1.read(); cin >> bigint1 >> bigint2; //bigint1.write(); //cout << bigint1 ; //bigint2.read(); //cin >> bigint2; //bigint2.write(); cout << bigint1 <add(bigint2); /*bigint1+=bigint2; cout << bigint1; bigint1-=bigint2; cout << bigint1; */ cout << bigint1 - bigint2; cout << bigint1 + bigint2; if(bigint1 >= bigint2) cout << endl << "BigInt1 is greater or equal BigInt2" << endl; if(bigint1 <= bigint2) cout << endl << "BigInt1 is smaller or equal BigInt2" << endl; if(bigint1 > bigint2) cout << endl << "BigInt1 is greater than BigInt2" << endl; if(bigint1 < bigint2) cout << endl << "BigInt1 is smaller than BigInt2" << endl; if(bigint1 == bigint2) cout << endl << "BigInt1 is equal BigInt2" << endl; if(bigint1.isZero()) cout << endl << "BigInt1 is zero" << endl; if(bigint2 >= bigint1) cout << endl << "BigInt2 is greater or equal BigInt1" << endl; if(bigint2 <= bigint1) cout << endl << "BigInt2 is smaller or equal BigInt1" << endl; if(bigint2 > bigint1) cout << endl << "BigInt2 is greater than BigInt1" << endl; if(bigint2 < bigint1) cout << endl << "BigInt2 is smaller than BigInt1" << endl; if(bigint2 == bigint1) cout << endl << "BigInt2 is equal BigInt1" << endl; if(bigint2.isZero()) cout << endl << "BigInt2 is zero" << endl; return 0; }