| 比赛 | 202110省实验桐柏一中普及组联赛 | 评测结果 | AAAAAAAAAW |
|---|---|---|---|
| 题目名称 | 分数约分 | 最终得分 | 90 |
| 用户昵称 | 192837465j | 运行时间 | 0.000 s |
| 代码语言 | C++ | 内存使用 | 0.00 MiB |
| 提交时间 | 2021-10-18 18:50:49 | ||
#include<bits/stdc++.h>
#define ull unsigned long long
using namespace std;
ull gcd(ull a, ull b) {
if(!b) return a;
return gcd(b, a % b);
}
void yuefen(ull &a, ull &b) {
ull d = gcd(a, b);
a /= d;
b /= d;
}
int main() {
freopen("yuefen.in", "r", stdin);
freopen("yuefen.out", "w", stdout);
ull a, b;
cin>>a>>b;
yuefen(a, b);
cout<<a<<" "<<b;
return 0;
}