blob: 60b73dc72cc8218e80d274c798ee350114505b8a (
plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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;
}
|