From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- Bachelor/Prog1/Prakt6/prg1p6_3/main.cpp | 74 +++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 Bachelor/Prog1/Prakt6/prg1p6_3/main.cpp (limited to 'Bachelor/Prog1/Prakt6/prg1p6_3/main.cpp') 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 +#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; +} \ No newline at end of file -- cgit v1.2.3