蓝桥杯2018省赛A组第1题 分数
题目链接http://oj.ecustacm.cn/problem.php?id=1359
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
typedef long long ll;
using namespace std;
ll solve(ll a, ll b) {
ll c;
while (b) {
c = a % b;
a = b;
b = c;
}
return a;
}
int main() {
ll a = pow(2, 20) - 1;
ll b = pow(2, 19);
ll t = solve(a, b);
printf("%lld/%lld", a / t, b / t);
return 0;
}
罗老师的代码链接https://blog.csdn.net/weixin_43914593/article/details/112517638