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.
18 lines
383 B
18 lines
383 B
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
// 辗转相除法
|
|
// 李永乐老师讲辗转相除法
|
|
// https://v.qq.com/x/cover/0ekhxvyhbdh4h7u/n09564m4hsw.html
|
|
|
|
int main() {
|
|
int a, b, c;
|
|
cin >> a >> b >> c;
|
|
int mx = max({a, b, c});
|
|
int mi = min({a, b, c});
|
|
int g = __gcd(mi, mx);
|
|
cout << mi / g << "/" << mx / g << endl;
|
|
return 0;
|
|
}
|