Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Object-oriented Programming / 06-Practice-29.03.2022 / ex2 / Source.cpp
diff options
context:
space:
mode:
1 files changed, 10 insertions, 12 deletions
-rw-r--r--Year 1/Object-oriented Programming/06-Practice-29.03.2022/ex2/Source.cpp22
diff --git a/Year 1/Object-oriented Programming/06-Practice-29.03.2022/ex2/Source.cpp b/Year 1/Object-oriented Programming/06-Practice-29.03.2022/ex2/Source.cpp
index 149ff8e..7818ed9 100644
--- a/Year 1/Object-oriented Programming/06-Practice-29.03.2022/ex2/Source.cpp
+++ b/Year 1/Object-oriented Programming/06-Practice-29.03.2022/ex2/Source.cpp
@@ -1,17 +1,15 @@
+#include <iostream>
#include "Rational.h"
int main() {
-
+ int a, b;
+ Rational r;
+ while (true) {
+ std::cin >> a >> b;
+ r = Rational(a, b);
+ r.canonize();
+ r.print();
+ std::cout << std::endl;
+ }
}
-/*
-
-5 - 1 = 4
-5 / 1 = 5
-
-5 - 9 = -4
-5 / 9 = 0...
-
-5 - 5 = 0
-5 / 5 = 1
-*/