diff options
Diffstat (limited to 'Bachelor/Prog1/Prakt6/prg1p6_3/main.cpp')
| -rw-r--r-- | Bachelor/Prog1/Prakt6/prg1p6_3/main.cpp | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/Bachelor/Prog1/Prakt6/prg1p6_3/main.cpp b/Bachelor/Prog1/Prakt6/prg1p6_3/main.cpp new file mode 100644 index 0000000..60b73dc --- /dev/null +++ b/Bachelor/Prog1/Prakt6/prg1p6_3/main.cpp @@ -0,0 +1,74 @@ +// 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 <new>
+#include <iostream>
+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 <<bigint2;
+
+ //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;
+}
\ No newline at end of file |
