Bài toán nhập vào 2 phân số, tìm phân số lớn nhất và xuất kết quả. CODE: Select All /*----------------------------------------------------------------------------*/#include <conio.h>#include <iostream.h>#include <math.h>/*----------------------Khai_Bao_Phan_So--------------------------------------*/typedef struct{int a,b; } PS; /*----------------------Nguyen_Mau_Nhap_Xuat----------------------------------*/ostream& operator<< (ostream& os, PS p); istream& operator>> (istream& is,PS &p); /*----------------------Cac_Nguyen_Mau_Ham------------------------------------*/int uscln(int x, int y); PS rutgon(PS p); /*---------------------Nguyen_Mau_Cac_Toan_Tu---------------------------------*/PS operator+(PS p1, PS p2); PS operator-(PS p1, PS p2); PS operator*(PS p1, PS p2); PS operator/(PS p1, PS p2); /*---------------------Dinh_Nghia_TTXuat--------------------------------------*/ostream& operator<< (ostream& os, PS p){os << p.a << '/' << p.b ; return os; }/*---------------------Dinh_Nghia_Nhap----------------------------------------*/istream& operator>> (istream& is,PS &p){cout << "\n Nhap tu va mau: " ; is >> p.a >> p.b ; return is; }/*----------------------------------------------------------------------------*/int uscln(int x, int y){x=abs(x);y=abs(y); if (x*y==0) return 1; while (x!=y){ if (x>y) x-=y; else y-=x; }return x; }/*----------------------------------------------------------------------------*/PS rutgon(PS p){PS q;int x; x=uscln(p.a,p.b); q.a = p.a / x ; q.b = p.b/ x ; return q; }/*----------------------------------------------------------------------------*/PS operator+(PS p1, PS p2){PS q; q.a = p1.a*p2.b + p2.a*p1.b; q.b = p1 .b * p2.b ; return rutgon(q); }/*----------------------------------------------------------------------------*/PS operator-(PS p1, PS p2){PS q; q.a = p1.a*p2.b - p2.a*p1 .b; q.b = p1.b * p2.b ; return rutgon(q); }/*----------------------------------------------------------------------------*/PS operator*(PS p1, PS p2){PS q; q.a = p1.a * p2.a ; q.b = p1.b * p2.b ; return rutgon(q); }/*----------------------------------------------------------------------------*/PS operator/(PS p1 , PS p2){PS q; q.a = p1.a * p2.b ; q.b = p1.b * p2.a ; return rutgon(q); }/*----------------------------------------------------------------------------*/int main(){PS p, q, z, u, v ; PS s; cout <<"\nNhap cac PS p, q, z, u, v: " ; cin >> p >> q >> z >> u >> v ; s = (p - q*z) / (u + v) ; cout << "\n Phan so s = " << s<<"\n"; //getch(); return 0;}/*----------------------------------------------------------------------------*/