From ef6d8e6de6061015e7dd41e2f74b733515b4a2e2 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 30 Mar 2022 15:17:07 +0300 Subject: Completed ex2 from yesterdays oop practice --- .../06-Practice-29.03.2022/ex2/Source.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'Year 1/Object-oriented Programming/06-Practice-29.03.2022/ex2/Source.cpp') 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 #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 -*/ -- cgit v1.3.1-23-gd82d