1022 TDA Rational(Play with oop)
URI 1022 TDA Rational : It is so easy problem. so after see solution try your self. It can be solve various way.But i am use OOP for practicing OOP.And i am use some extra thing. If you solve the problem.But it is not accepted than use uDebug to find out the BUG. Here is the problem uDebug Link . C++ code: #include<iostream> #include<math.h> using namespace std; int GCD(int num1,int num2){ if(num1%num2==0){ return num2; }else{ return GCD(num2,num1%num2); } } class rational{ private: int numerator{0}; int denominator{0}; public: void setData(int numerator,int denominator){ this->numerator = numerator; this->denominator = denominator; }friend ostream& operator<<(ostream& out,rational &ob); rational operator+(rational ro)...








মন্তব্যসমূহ
একটি মন্তব্য পোস্ট করুন