#include
using namespace std;
void reduce(int* m, int* n) {
int a,b,c;
a=*m; b=*n;
// НОД a b - алгоритм Евклида
do {
c=a%b; a=b; b=c; }
while (b>0);
*m/=a; *n/=a;
}
int main() {
int m,n;
cout<<"input m n "; cin>>m>>n;
cout<<m<<"/"<<n<<" = ";<br> reduce(&m,&n);
if (n>1) cout<<m<<"/"<<n<<endl;<br> else cout<<m<<endl;<br> system("pause");
return 0;
}
input m n 25 15
25/15 = 5/3