求救神佬
by taotao0507 @ 2023-11-30 21:08:58
《```if(b==0) return b;```》
by __f0r_1_1n_ran9e__ @ 2023-11-30 21:25:26
@[taotao0507](/user/536590)
by __f0r_1_1n_ran9e__ @ 2023-11-30 21:26:25
a和b输出反了。。
```cout<<b<<" "<<a<<"\n";```
```cpp
#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y)
{
while (y ^= x ^= y ^= x %= y)
;
return x;
}
int main()
{
int a, b, c, d;
scanf("%d/%d %d/%d", &a, &b, &c, &d);
a *= c;
b *= d;
int m = gcd(a, b);
a /= m;
b /= m;
cout << b << " " << a << "\n";
return 0;
}
```
by XNULL666 @ 2023-11-30 21:27:57
@[xmc6666](/user/550324) 谢谢,改了就ac了,是我眼瞎
by taotao0507 @ 2023-12-17 12:56:44
@[__f0r_1_1n_ran9e__](/user/747879) 谢谢,已经改了。
by taotao0507 @ 2023-12-17 12:58:03