You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
492 B

#include <bits/stdc++.h>
using namespace std;
//辗转相除法
int measure(int x, int y)
{
int z = y;
while(x%y!=0)
{
z = x%y;
x = y;
y = z;
}
return z;
}
int main() {
int a,b,c;
cin>>a>>b>>c;
int max=0,min=10000000;
if(a>max) max=a;
if(b>max) max=b;
if(c>max) max=c;
if(a<min) min=a;
if(b<min) min=b;
if(c<min) min=c;
int gcd=measure(min,max);
cout<<min/gcd<<"/"<<max/gcd<<endl;
return 0;
}