```cpp
#include<iostream>
#include<algorithm>
using namespace std;
long long a[3],q,w;
long long gcd(long long a,long long b)
{
return b==0?a:gcd(b,a%b);
}
int main()
{
for(int i=0;i<3;i++)
cin>>a[i];
sort(a,a+3);
q=a[0]/gcd(a[0],a[2]);
w=a[2]/gcd(a[0],a[2]);
cout<<q<<"/"<<w;
return 0;
}
```
找不同?@[心对心天](/space/show?uid=123549)
by Hexarhy @ 2019-02-02 22:28:54
竟然开O2
by 康师傅 @ 2019-02-02 22:36:38
```cpp
#include <iostream>
#include <queue>
using namespace std;
priority_queue<int>qwq;
long int gcd(long int a,long int b)
{
return (a%b==0)?b:gcd(b,a%b);
}
int main()
{
long int input[4],maxn,minn,temp;
for (int i=1;i<=3;i++)
{
cin>>input[i];
qwq.push(input[i]);
}
for (int i=1;i<=3;i++)
{
input[i]=qwq.top();
qwq.pop();
}
maxn=input[1],minn=input[3];
temp=gcd(maxn,minn);
maxn=maxn/temp,minn=minn/temp;
cout<<minn<<'/'<<maxn;
return 0;
}
```
试试这个?@[心对心天](/space/show?uid=123549)
~~也许是交换变量的时候出错了~~
by Jelly_Goat @ 2019-02-02 22:43:49
@[Jelly_Goat](/space/show?uid=122927)
@[HyyypRtf06](/space/show?uid=80049)
谢谢
by 心对心天 @ 2019-02-03 08:44:29
@[心对心天](/space/show?uid=123549)
not at all...
~~还是想知道您的代码哪里出了问题~~
by Jelly_Goat @ 2019-02-03 09:40:48
@[Jelly_Goat](/space/show?uid=122927)
~~**我的代码,如果a是最大值则会被覆盖掉**~~
by 心对心天 @ 2019-02-03 10:44:03