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:
Commitef6d8e6de6061015e7dd41e2f74b733515b4a2e2 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-03-30 15:17:07 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-03-30 15:17:07 +0300
Files285ccedc5b4296a7022f4de131bbb5ab44bd99bc /Year 1/Object-oriented Programming/06-Practice-29.03.2022/ex2/Source.cpp
uni-projects-ef6d8e6de6061015e7dd41e2f74b733515b4a2e2.tar
uni-projects-ef6d8e6de6061015e7dd41e2f74b733515b4a2e2.tar.gz
uni-projects-ef6d8e6de6061015e7dd41e2f74b733515b4a2e2.zip
Parent793100813b3c50a1f304904440366a7137ae0992 (diff)
Completed ex2 from yesterdays oop practice
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
-*/